Cannot access the python interpreter for FCGI script

Discussion in 'Apache' started by nytrokiss, Mar 29, 2008.

  1. #1
    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!
    
    Code (markup):
    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()
    Code (markup):
    Thank You very much!
    James
     
    nytrokiss, Mar 29, 2008 IP
  2. SSANZ

    SSANZ Peon

    Messages:
    861
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What error is apache spitting out at logs?

    Regards,
    SSANZ
     
    SSANZ, Apr 1, 2008 IP