[mod_python] Getting modpython and php to work on the same computer

Jason Lanquist jason at ruff.com
Thu Mar 10 11:37:59 EST 2005

I've been having problems getting Python/mod_python/MySQLdb to work on
my computer at home.  I finally figured out that if I commented out my
php module from loading in my httpd.conf file then mod_python would
work.  I'm wondering if there is a way to get mod_python to work even
when php is loaded.

system info:
Linux Slackware 8.1 w/ 2.4.22 kernel
Apache          2.0.49
Python          2.3.3
mod_python      3.1.3
MySQL-python    0.9.2
PHP             4.3.4

Specific error:

--- from httpd.conf ---
LoadModule python_module /usr/local/apache/modules/mod_python.so
LoadModule php4_module   /usr/local/apache/modules/libphp4.so
--- /from httpd.conf ---

Actually, there were no errors reported to the browser.  Mod_Python
would silently stop execution and the only evidence of anything strange
in log files was an "exit signal Segmentation fault (11)" in my apache
error log.

--- from httpd.conf ---
LoadModule python_module /usr/local/apache/modules/mod_python.so
#LoadModule php4_module   /usr/local/apache/modules/libphp4.so
--- /from httpd.conf ---

If I commented out php4_module in httpd.conf, then everything worked
fine in python.  Unfortunately, php doesn't work in this case.

I'm able to duplicate this behavior on a different computer with the
same things installed so I'm not thinking it's a hardware issue

Any help would be greatly appreciated!

Jason Lanquist

More information about the Mod_python mailing list