Welcome to WebmasterWorld Guest from

Forum Moderators: bakedjake

Message Too Old, No Replies

Cannot access the python interpreter

Even with the #!/usr/bin/python as the first line.

9:09 pm on Mar 29, 2008 (gmt 0)

New User

10+ Year Member

joined:Mar 3, 2007
posts: 11
votes: 0


I cannot execute a FCGI script in python on my web server. When i execute it using the command line "python hello.fcgi" i get a normal response

Status: 200 OK
Content-Type: text/plain
Content-Length: 13
Hello World!

However when i try to go to the web page i get a 500 error. I get this error message "FastCGI: incomplete headers (0 bytes) received from server" so i tried to execute the script using the sell "./hello.fcgi" and i got this error message ": bad interpreter: No such file or directory"

Here is the code:

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

Thank You very much!

6:47 pm on Mar 31, 2008 (gmt 0)

Preferred Member

10+ Year Member

joined:July 13, 2006
votes: 0

What does 'which python' output on the server? Change the shebang line to match that.

If which python returns something like No python found in x then make sure python is installed properly.