CGI Python problem

Tim O'Toole timotoole at gmail.com
Thu Nov 6 19:23:59 EST 2008


With regard to phpinfo(), its shows the mod_cgi is loaded, but neither
mod_perl or mod_python is loaded (I read on the python.org site that
mod_python can interfere with running python through mod_python).

As for writing some perl, not too sure how to do that, but from the
information in phpinfo I logged onto the webserver machine and did a
"whereis python" - it came back blank! Of course doing a whereis perl
gave a non-blank answer. So this seems to be the route cause of my
trouble.

Now to work around that, I've tried to change the shebang in the
python test file to the location of python on my local machine, but
still no use?

any thoughts?





>> 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?
>
> It's certainly something to check...Apache may run in a chroot'ed
> environment where Perl may be available, and Python may not (or it may be
> someplace else in the chroot environment).
>
> If you've got Perl hacking skills, you might throw together a simple
> perl-script that checks to see if /usr/bin/python exists where you think it
> is, or walks the directory tree returning the path of files containing the
> word "python". My perl skills are close to non-existent (only having
> reverse-engineered some hand-me-down perl code)
>
>> Also I'm not sure how to check if the server is running mod_perl?
>
> I think that's usually (assuming your admin hasn't munged them) included in
> the headers returned from the server, or if you've got PHP installed in the
> same setup, you can create a simple PHP page to dump the info (with this one
> line in it):
>
>  <?php phpinfo();?>
>
> which should include a line for the modules loaded in Apache.
>
> Hope this gives you a few more things to check,
>
> -tkc
>
>
>
>
>



More information about the Python-list mailing list