Python With FastCGI Problem

software development

#1

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

[code]#!/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()
[/code]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

[code]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"

[/code]and my file chmod 755 already.

My Blog