![]() |
apache/mod_python problem: ImportError: No module named mod_python.apache
For reasons that I won't get into in this thread, I've built a webserver that runs out of my homedir (with php & sqlite to boot). Now, however, I need python, so I'm trying to build/install mod_python. To get the build to work, I needed to also build/install python, which I've done (all running out of my homedir). I can build & install mod_python fine now. I've edited my httpd.conf to load up the mod_python.so from my homedir.
Watching apache's logs on startup, I can see it loading up mod_python: Code:
[Thu Sep 27 14:56:32 2007] [notice] mod_python: Creating 8 session mutexes based on 256 max processes and 0 max threads.Code:
from mod_python import apacheCode:
[Thu Sep 27 14:56:48 2007] [error] make_obcallback: could not import mod_python.apache.\nFWIW, I configured mod_python like so: ./configure --prefix=$HOME/local --with-apxs=$HOME/local/bin/apxs --with-python=$HOME/local/bin/python Any help would be much appreciated. |
Yes, I would say it is something to do with your python paths. Find the file
slocate mod_python (or mod_python.apache) Then check that the file is in a directory referred to by "Python path being used" Dont know if thats the problem but its certainly one option you could easily eliminate |
Solved.
It was a path issue. The simple solution is to set an env var PYTHONHOME to the base of the python install (i.e. where you pointed --prefix to in the configure step). Once that's done, in the same shell, restart apache. So, in my case, it went a little like this: Code:
./configure --prefix=$HOME/local --with-apxs=$HOME/local/bin/apxs --with-python=$HOME/local/bin/python --with-python-src=$HOME/install/Python-2.5.1 |
| All times are GMT -5. The time now is 12:00 PM. |