Reputation: 6117
I'm currently moving all my Python CGI scripts to WSGI standard using Flup (http://trac.saddi.com/flup), I created a dispatch.fcgi file calling and using Flup as described in the documentation:
from flup.server.fcgi import WSGIServer
...
and works like a charm, the problem comes when I try to switch to CGI to debug something in non-cached mode, avoiding to kill processes or touch files, this should be as simple as replace the Flup server to import:
from flup.server.cgi import WSGIServer
...
but then the browser returns me a 500 error, I checked the headers and html executing through SSH and seems to be ok, then I figured should be some server misconfiguration (Dreamhost shared) and I discover the server is not able to execute Python scripts with .fcgi extension, so I found a workaround adding this to .htaccess file:
AddHandler cgi-script .fcgi
then the CGI mode almost works (wsgi.input is always empty, even reading it in a proper way passing the length) but FCGI caching doesn't works at all, starting a lot of processes. At this moment I'm totally deadlocked, I just want a simple way to switch from FCGI to CGI, is this method valid? or I'm missing something?
Thanks a lot.
Upvotes: 0
Views: 1177
Reputation: 1068
FCGI protocol is different from CGI. That's why the simple change from FCGI to CGI didn't work and the FCGI would not work when changing the Apache .fcgi file handler to CGI handler.
Upvotes: 1