CGI Python problem

Tim O'Toole timotoole at gmail.com
Thu Nov 6 11:33:05 EST 2008


Thanks for replying Tim,

Here is the permissions, which I think are definitely right now:

drwxrwxrwx   8 **** **** 4.0K Nov  6 13:34 public_html/

drwxrwxrwx   2 **** **** 4.0K Nov  6 13:35 cgi-bin/ [inside public_html]

-rw-r-xr-x  1 **** ****  117 Nov  6 11:39 test_pl.cgi* [inside cgi-bin]
-rw-r-xr-x  1 **** ****  168 Nov  6 13:35 test_py.cgi* [inside cgi-bin]

note both have *.cgi extensions otherwise plain text is shown.


the perl file correctly outputs hello world whereas the python file
gives a 500 internal server error warning.

Also I think I should be getting a traceback since I used import
cgitb; cgitb.enable() I wonder does this suggest the python
interpreter hasn't be found?


Also I'm not sure how to check if the server is running mod_perl?


Thanks for the help, much appreciated

>
> My guess would be the permissions are awry -- if I parse that correctly, 744
> is -rwxr--r-- which means that other users (such as the user your server
> runs as, likely "www" or "wwwdata"?) can't execute the shell-script.  As a
> first pass, I'd ensure that the file has permissions, and the directory can
> be scanned by the webserver ("eXecute" permissions on the containing
> directory):
>
>  bash$ cd ~/public_html/cgi-bin
>  bash$ chmod go+rx test.py .
>
>> As a test I tried a perl cgi hello world test, and this worked
>> correctly.
>
> If the perl script is working correctly, I suspect the directory permissions
> are set correctly, so I'd compare permission of the .pl vs. the .py scripts
> to see if they're the same. Alternatively, if your server is running
> mod_perl, it might be short circuiting the CGI aspect, detecting the .pl
> file & running it, and thus might be a red herring.  (not using
> perl/mod_perl, I don't know the ins and outs of this, so I could be waaaaay
> off base on this line of thinking)
>
> Just my first-pass debugging thoughts,
>
> -tkc
>
>
>
>
>
>
>
>
>



More information about the Python-list mailing list