Thanks for the reply. I tried that and it didn't work. I think the reason is that the LD_LIBRARY_PATH is meant for the Python interpreter to know where to load the .so files. It's too late to set it in Python code because at that point the interpreter is already running ...
I still don't quite understand why calling the shell script doesn't work. My understanding is that flup server checks the environment variables to see if it should run as a fcgi server (as opposed to scgi or http server) but I don't see the environment variables in the Python script. Maybe the flup code has stripped them. But no matter how, the shell script should pass all env vars to its child process. > You can set that environment variable in python. Add this to the top > of you scritp: > import os > os.environ['LD_LIBRARY_PATH'] = '/usr/local/lib/my_lib_dir' > And then it should work correctly. Not entirely sure why lighttpd > won't let that work though. > On Apr 25, 4:25 am, [email protected] wrote: >> Hi, >> >> I'm using lighttpd with web.py. When lighttpd starts, >> it starts code.py, too. This is all good. >> >> However in order to call a Python library, I have to start web.py >> app from a shell script, where LD_LIBRARY_PATH is set. >> >> I find that after replacing the .py file with .sh file, >> lighttpd fails to start code.py with this error: >> >> (mod_fastcgi.c.1029) child exited with status 8 >> >> I wonder how web.py detects that it's run in FastCGI mode? >> I logged the arguments but it seems that when lighttpd >> starts code.py, no argument is used. So my question is, >> instead of specifying the python file in lighttpd, can I >> use a shell script that calls the python file? >> >> My shell script looks like this: >> >> export LOAD_LIBRARY_PATH=/usr/local/lib/my_lib_dir >> cd /opt/my_code_dir >> ./code.py fcgi --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/webpy?hl=en -~----------~----~----~----~------~----~------~--~---
