| Cannot access the python interpreter Even with the #!/usr/bin/python as the first line. |
nytrokiss

msg:3614372 | 9:09 pm on Mar 29, 2008 (gmt 0) | Hi 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: #!/usr/bin/python from fcgi import WSGIServer def myapp(environ, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) return ['Hello World!\n'] WSGIServer(myapp).run()
Thank You very much! James
|
mikedee

msg:3615579 | 6:47 pm on Mar 31, 2008 (gmt 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.
|
|
|