If you pass the script to spawn-fcgi via the "-f", it expects a shell
script (which for obvious reasons has hard times with the python syntax ^^)

So the way to go is:

% spawn-fcgi -a ... -p ... -- /home/lbfm/www/lbfm_web/index.py

(Note the double dash in front of the path. It is required and must be
AFTER the other arguments to spawn-fcgi)

And another small hint: As I sometimes have to run my script from
commandline and not via FCGI (e.g. for debugging), I got tired to
delete/comment the "web.wsgi.runswgi = ..." line.

But I found a nice way to tell the script, when it is run via fcgi --
pass "fcgi" as a cmdline argument. This seems to be an undocumented
feature of webpy.

Hence my __main__ is:

if __name__ == "__main__":
    app.run()

And the spawn-fcgi command:

% spawn-fcgi -a ... -p ... -- /my/path/to/index.py fcgi

- René

Am 27.01.2011 23:07, schrieb Carlos Ríos Vera:
> Hello world,
> 
> Im trying to run an app made with webpy using spawn-fcgi to launch the app.
> 
> The code in the __main__ section is:
> 
> if __name__ == '__main__':
>     web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr)
>     app.run()
> 
> And I run spawn-fci as follows:
> 
> % spawn-fcgi -f /home/lbfm/www/lbfm_web/index.py -a 127.0.0.1 -p 9002
> 
> 
> But I got this:
> 
> % spawn-fcgi -f /home/lbfm/www/lbfm_web/index.py -a 127.0.0.1 -p 9002
> : No such file or directory
> spawn-fcgi.c.218: child exited with: 127, Key has expired
> 
> 
> I really don't have idea what happens, any clue?
> 
> Regards
> 
> 


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to