configuring mxCGIPython
Mark McEahern
mark at mceahern.com
Wed Apr 24 16:25:41 EDT 2002
Hi, I'm trying to configure mxCGIPython:
http://www.egenix.com/files/python/mxCGIPython.html#Install
I'm stuck at step 4, chmod 755 the path to the binary file cgipython. I'm
using this cgi script:
#!/bin/sh
echo content-type: text/html
echo
path=`pwd`
cgifile=$path/cgipython
if [ -f $cgifile ]
then
echo Making $cgifile executable...
if chmod -v 755 $cgifile
then
echo Successful.
else
echo Failed.
fi
else
echo $cgifile does not appear to exist.
fi
I get these results:
Making /home/chain/pythons/cgipython executable...
failed to change mode of /home/chain/pythons/cgipython to 0755 (rwxr-xr-x)
Failed.
If I ftp to the server, I can chmod 755 the specific file. If I change the
script just to reference the filename (not the full path), it works.
The problem is that the shebang line for the Python cgi files needs to have
the full path, I think. If I don't chmod the full path, it doesn't work.
The full path would be:
#!/home/chain/pythons/cgipython
I've also tried using a relative path for the shebang line. The cgi-bin
folder and the folder where cgipython is stored are siblings, so relative to
the Python cgi files in cgi-bin, the path to the cgipython file should be:
../pythons/cgipython
But I've tried:
#!../python/cgipython
#!/python/cgipython
None of these work. I simply get the internal server error.
Any ideas?
Thanks,
// mark
More information about the Python-list
mailing list