Cannot import mod_python modules

M

Mark

Hi, I've just installed the Win32 build of mod_python 3.1.4 for Python
2.4 and have setup my Apache config file with the LoadModule and
PythonHandler directives and then copied "mod_python.so" to my Apache
modules directory.

I restarted Apache and decided to do a quick cgi.test() and it shows
that mod_python listed under server software section.

OK, next I tried mptest.py, but I get an Internal Server Error. The
traceback recorded in the error log says "No module named _apache"

mptest.py:

from mod_python import apache

def handler(req):
req.write("Hello World!")
return apache.OK

Why doesn't this work? or rather what have I missed?
 
S

Steve Holden

Mark said:
Hi, I've just installed the Win32 build of mod_python 3.1.4 for Python
2.4 and have setup my Apache config file with the LoadModule and
PythonHandler directives and then copied "mod_python.so" to my Apache
modules directory.

I restarted Apache and decided to do a quick cgi.test() and it shows
that mod_python listed under server software section.

OK, next I tried mptest.py, but I get an Internal Server Error. The
traceback recorded in the error log says "No module named _apache"

mptest.py:

from mod_python import apache

def handler(req):
req.write("Hello World!")
return apache.OK

Why doesn't this work? or rather what have I missed?

Usually this is a permissions issue, often because you installed
mod_python as a non-administrator.

regards
Steve
 
M

Mark

Thanks for the reply Steve,

I have re-installed mod_python and re-configured Apache and it works
now. I'm not exactly sure what I done differently, but oh well at
least it works now :)

Regards,

Mark.
 
S

Steve Holden

Mark said:
Thanks for the reply Steve,

I have re-installed mod_python and re-configured Apache and it works
now. I'm not exactly sure what I done differently, but oh well at
least it works now :)

Regards,

Mark.

Right, no point wasting much sleep when mod_python awaits!

regards
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top