[Tutor] CGI Help

Seabrook, Richard rhseabrook@aacc.edu
Tue Apr 8 08:18:02 2003


See response below.

-----Original Message-----
From:	Timothy M. Brauch [mailto:tbrauch@mindless.com]
Sent:	Tue 4/8/2003 12:06 AM
To:	Seabrook, Richard; Python Tutor
Cc:=09

There are no lines in my error_log that says anything is going wrong.  =
Here is what my access_log has to say about it:

win98.tbrauch - - [07/Apr/2003:23:07:36 -0400] "GET /simple/simple.html =
HTTP/1.1" 200 676 "http://192.168.xxx.xxx/simple/"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; YComp 5.0.2.6; .NET CLR =
1.0.3705)"
win98.tbrauch - - [07/Apr/2003:23:07:38 -0400] "POST /simple/simple2.py =
HTTP/1.1" 200 978
"http://192.168.xxx.xxx/simple/simple.html" "Mozilla/4.0 (compatible; =
MSIE 6.0; Windows 98; YComp 5.0.2.6; .NET CLR 1.0.3705)"
win98.tbrauch - - [07/Apr/2003:23:08:27 -0400] "POST /simple/simple2.py =
HTTP/1.1" 200 978
"http://192.168.xxx.xxx/simple/simple.html" "Mozilla/4.0 (compatible; =
MSIE 6.0; Windows 98; YComp 5.0.2.6; .NET CLR 1.0.3705)"

Note, win98.tbrauch is my windows computer.  I have tried accessing the =
files from it.  And, 192.168.xxx.xxx is the internal IP
address for my linux computer.

I feel like it might be a path or permissions problem, but I'm not =
really sure what to change.  I've been playing with Linux on my
own for about 5 months now, so I'm a newbie.

Oh, one more thing.  I tried:

[root@linux0 simple]# python simple2.py

And it worked fine, it sent the email and no errors.  However, when I =
try:

[root@linux0 simple]# ./simple2.py
: bad interpreter: No such file or directory

Other files work if I try ./file_name.py, even if I put them in the same =
directory, just not this one.

 - Tim
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D

Check the first line of your simple2.py file very carefully
to make sure it doesn't have a DOS CRLF combination at the end
rather than just a UNIX LF (newline).  If you're working between
Win98 and Linux it's easy to have this happen, and in most
cases the shell won't interpret the shebang line (#!/usr/bin/python)
correctly with DOS end-of-record markers.  If you open simple2.py
with Vim it will probably say (DOS) at the bottom.
Dick S.