Python With FastCGI Problem

Python With FastCGI Problem

Posted by: zhuzhu
Posted on: 2007-04-14 09:26:00

I have two pythom script whit .cgi and .fcgi , the content flow:

#!/home/{username}/packages/bin.python

def myapp(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
return ['Hello World!n']

if __name__ == '__main__':
from fcgi import WSGIServer
WSGIServer(myapp).run()

http://trac.webcan.cn/m_shop/test.cgi
http://trac.webcan.cn/m_shop/test.fcgi

the test.cgi work fine, but test.fcgi can't work with the error logs:

[Sat Apr 14 09:09:25 2007] [error] [client 222.212.216.19] FastCGI: comm with (dynamic) server "/home/user/trac.webcan.cn/m_shop/test.fcgi" aborted: (first read) idle timeout (60 sec)
[Sat Apr 14 09:09:25 2007] [error] [client 222.212.216.19] FastCGI: incomplete headers (0 bytes) received from server "/home/user/trac.webcan.cn/m_shop/test.fcgi"

my $HOME/.bash_profile

umask 002
PS1='[h]$ '
PATH=~/bin:$PATH
export PATH
if [ "$TERM" = "rxvt-unicode" ]; then
TERM="rxvt"
export TERM
fi
export PYTHONPATH="$HOME/packages/lib/python2.3/site-packages"
export LD_LIBRARY_PATH="$HOME/packages/lib"
export PATH="$HOME/packages/bin:$PATH"

and my file chmod 755 already.


My Blog

Tags: fcgicnchmod 755fastcgiexport pathtest cgipythonlibdynamic server60 sechello worldld librarylibrary patherror logsumaskwhitaborted