[mod_python] mod_python

Graham Dumpleton graham.dumpleton at gmail.com
Thu Aug 30 19:39:16 EDT 2007


On 31/08/2007, Chris Howell <chowell at pyxisinnovation.com> wrote:
>
>  Hi All,
>
>  I've installed the Apache webserver 2.2.4 onto a machine. I am trying to
> get the python mod working for the apache webserver.  I installed
> mod_python-3.3.1, for windows and I have the correct version of Python
> installed. I did everything the install asked me to do, when I edited my
> httpd.conf file for apache I added this line
>
>  LoadModule python_module modules/mod_python.so
>
>  Where all of the other load modules happen, to be.
>
>  So I shut the apache server down and I restarted it when I restart the
> server I get this error message.
>
>  "Cannot load C:/Program Files/Apache Software
> Foundation/Apache2.2/modules/mod_python.so into server. The
> specified procedure could not be found.
>
>  When I went to the modules directory, under the apache root, the
> mod_python.so file does exist so I am not sure what the problem is or what
> the solution is. Any light someone could shed on this would be greatly
> appreciated.

Following is a summary of common problems on Windows.

1. Wrong version of mod_python installed for version of Python/Apache
installed, or you have multiple versions of Python installed and the
DLL for the wrong one is being found in your PATH first causing a
failure to load the module. Look for all instances of PYTHONXY.DLL on
your system, where XY is a version number. Even if you didn't
explicitly install more than one version of Python, there are a number
of third party packages which install their own internal version of
Python and if they are in your PATH first it can screw things up.

2. Python/Apache/ModPython when installed was not installed as an
Administrator and as a result the DLLs are not in the operating system
library. If Apache is then started as a service, it may not be able to
find the required DLLs, or they may not have permissions such that the
Apache service can read them.

3. You have installed/uninstalled multiple versions of Python and
there are old Windows registry entries for another version still in
existence which is causing problems.

Because of where the problem is occurring, I would suggest it is a
permissions problem or inability to find appropriate DLLs. Thus
explore those possibilities first and come back to us with what you
find. Let us know things like whether you are running Apache as a
service, where the Python DLL and Microsoft C/C++ runtime DLLs are
located etc. Also indicate whether you are using www.python.org
version of Python or another distributors version.

Often these sorts of problems vanish when Python/Apache/ModPython are
all uninstalled, and then reinstalled as Administrator. Thus perhaps
also try that.

Graham


More information about the Mod_python mailing list