[mod_python] Problems with Windows as usual.

Dustin Boyd rpgfan3233 at gmail.com
Sat May 24 16:24:29 EDT 2008


I recently upgraded to Python 2.5.2, Apache 2.2.8+OpenSSL 0.9.8g and
mod_python 3.3.1 on Windows XP SP2. I'm not sure why the configuration
broke just by upgrading, but it seems Python can't 'import site'
(site.py). I've tried things like setting PythonPath in httpd.conf,
and Apache's error log ends up with the following problems:
'import site' failed; use -v for traceback
ImportError: No module named mod_python.apache


I'm not sure what the problem is to be honest. If I was on a Linux
box, I'd have no problem according to the bits that I've read online
about this problem (just set PYTHONHOME to the correct directory and
things should be good). Unfortunately, that isn't the case. :(

Here is my httpd.conf file with only the Python bits in it:

LoadModule python_module modules/mod_python.so
# skipping some
<IfModule python_module>
  <Directory "C:/server/docs/python">
      AddHandler mod_python .py
      PythonHandler mod_python.publisher
      PythonDebug On
  </Directory>
</IfModule>

I run a "Hello World" test, and I get an HTTP 500 response code when I
do it. The errors above are logged each time I run it. My PATH
variable has no mention of my Python base installation directory
(C:\Python25), and I copied python25.dll to Apache's bin directory as
suggested. That fixed problems that I had with mod_python not loading
at all (couldn't find the DLL file), but now I have this issue. I've
searched my computer for other python*.dll files, and there are only
two - one in the Python base installation directory and one in
Apache's bin directory. I would think that it was a conflict except
that if either one disappears, things don't work correctly.

I ran depends.exe on mod_python.so as suggested in some other threads,
and it seems that it can't find a couple of DLL files in Apache's bin
directory (libapr-1.dll, libhttpd.dll and libaprutil-1.dll), though it
can find python25.dll.

I'd very much like to get this working, but if I can't then I guess
I'll need to find a different way to serve up Python files.

If the filenames of the installation packages are important, here they are:
httpd-2.2.8-win32-x86-ssl.zip (from Apache Lounge)
python-2.5.2.msi (from Python.org)
mod_python-3.3.1.win32-py2.5-Apache2.2.exe (from the mod_python site,
then redirected to Apache's site to download mod_python)

Thanks for any help or tips you can give!

-- 
Waiting patiently for Windows 7, XHTML 2.0, CSS 3.0, PHP 6.0, the
ratification of C++0x, and the day that I can code without logic
troubles.


More information about the Mod_python mailing list