[mod_python] invalid command pythonhandler

Graham Dumpleton grahamd at dscpl.com.au
Thu Feb 23 16:37:45 EST 2006


If PythonHandler hasn't been recognised, then mod_python possibly hasn't
been loaded at all. Check the error log file for the Apache restart
message and see if it mentions mod_python. Also ensure you have
appropriate LoadModule directive and did actually restart Apache.

See:

  http://www.dscpl.com.au/articles/modpython-001.html

for other useful information.

Graham

Gianni - Infodata wrote ..
> Hi,
> 
> I have followed all indications to install python module for apache on
> the
> web page :
> (http://www.modpython.org/live/mod_python-2.7.8/doc-html/app-wininst.html)
> but when I start the server, this are the error lines :
> 
> "Syntax error on line 670 of c:/program files/apache
> group/apache/conf/httpd:
> Invalid command 'PythonHandler', perhaps mis-spelled or defined by a module
> included in the server configuration
> Note the errors or messages above, and press the <ESC> key to exit.  20..."
> 
> Somebody have already met this problem ?
> 
> Precisions :
> ----------------------------------------------------------------------------
> 
> The line which doesn't work in httpd.conf :
> It's the line "PythonHandler mptest" which redirect to "mptest.py".
> This file is in my "C:/Program Files/Apache Group/Apache/htdocs/python"
> .
> this file must print "Hello World"  in my browser.
> 
>    <Directory "C:/Program Files/Apache Group/Apache/htdocs/python">
>     AddHandler python-program .py
>     PythonHandler mptest
>     PythonDebug on
>    </Directory>
> 
> ----------------------------------------------------------------------------
> 
> Content of mptest.py :
> 
> from mod_python import apache
> 
> def handler(req):
>    req.content_type = "text/plain"
>    req.send_http_header()
>    req.write("Hello World!")
>    return apache.OK
> 
> ----------------------------------------------------------------------------
> 
> Configuration :
> 
> I have installed :
> - Apache : apache_1.3.33-win32-x86.exe
> - the python module files : mod_python-2.7.8.tgz
> - The dll of python module : mp152dll.zip
> - Python executable : py152.exe


More information about the Mod_python mailing list