Note that there are some explanatory texts on larger screens.

plurals
  1. PODifficulty getting flup fcgi script to work
    text
    copied!<p>I'm building a site for a client using django. It's been hosted on shared hosting and mod_wsgi can't be used. In the old year, I got it working using fcgi, but when I got back, it was broken.</p> <p>I have replaced the fcgi script with a simple hello world script:</p> <pre><code>#!/usr/bin/python def myapp(environ, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) return ['Hello World!\n'] try: from flup.server.fcgi import WSGIServer WSGIServer(myapp).run() except: import sys, traceback traceback.print_exc(file=open("errlog.txt","a")) </code></pre> <p>Tested and working on my local server, but on the hosted server, I get this error:</p> <pre><code>&lt;title&gt;FCGI Error&lt;/title&gt; A timeout occured while waiting for the script output (in: /usr/www/users/mymemb/). </code></pre> <p>If I look at the error log, I see this:</p> <pre><code>[Wed Jan 6 16:59:37 2010] [warn] FastCGI: (dynamic) server "/usr/www/users/mymemb/mymembers.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 10 seconds [Wed Jan 6 16:59:38 2010] [warn] FastCGI: (dynamic) server "/usr/www/users/mymemb/mymembers.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 10 seconds [Wed Jan 6 16:59:38 2010] [warn] FastCGI: (dynamic) server "/usr/www/users/mymemb/mymembers.fcgi" (user mymemb, gid 100) restarted (pid 1057) [Wed Jan 6 16:59:38 2010] [warn] FastCGI: (dynamic) server "/usr/www/users/mymemb/mymembers.fcgi" (pid 1057) terminated by calling exit with status '118' [Wed Jan 6 16:59:38 2010] [warn] FastCGI: (dynamic) server "/usr/www/users/mymemb/mymembers.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 10 seconds [Wed Jan 6 16:59:38 2010] [warn] FastCGI: (dynamic) server "/usr/www/users/mymemb/mymembers.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 10 seconds [Wed Jan 6 16:59:38 2010] [warn] FastCGI: (dynamic) server "/usr/www/users/mymemb/mymembers.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 10 seconds etc ... </code></pre> <p>If I ssh to the server, I can run the script fine, with the following output:</p> <pre><code>mymemb@www81:~/public_html$ ./mymembers.fcgi WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI! WSGIServer: missing FastCGI param SERVER_NAME required by WSGI! WSGIServer: missing FastCGI param SERVER_PORT required by WSGI! WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI! Status: 200 OK Content-Type: text/plain Content-Length: 13 Hello World! </code></pre> <p>How do I fix this?</p> <p><b>Added info:</b></p> <p>It seems like the script is not running at all. If I add import x at the top of the script, and run it from ssh, I see that x.pyc gets created. If I rm x.pyc, and then hit the site, x.pyc does not get created.</p> <p>I also noticed that the errors changed from </p> <pre><code>terminated by calling exit with status '118' </code></pre> <p>to </p> <pre><code>terminated by calling exit with status '116' </code></pre> <p>I wish I could find a reference for these exit statuses.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload