homepage Welcome to WebmasterWorld Guest from 54.161.181.49
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved