bin Neuling im Bereich mod_python und habe ein kleines Problem mit der Konfiguration:
Habe einen APACHE2.2.9, Python5.2 und mod_python3.3.1
Die Eintragungen in die httpd.conf sehen wie folgt aus:
<Directory "c:/xampp/htdocs/pytest">
AddHandler mod_python .py
# AddHandler python-program .py
PythonHandler mptest
PythonDebug On
</Directory>
<Location /mpinfo>
SetHandler mod_python
PythonHandler mod_python.testhandler
</Location>
Im Verzeichnis ""c:/xampp/htdocs/pytest" existiert eine Datei Namens: mptest.py
deren Inhalt lautet:
Code: Alles auswählen
from mod_python import apache
def handler(req):
req.content_type = 'text/plain'
req.write("Hello World!")
return apache.OK
MOD_PYTHON ERROR
ProcessId: 5736
Interpreter: 'localhost'
ServerName: 'localhost'
DocumentRoot: 'C:/xampp/htdocs'
URI: '/pytest/mptest.py'
Location: None
Directory: 'C:/xampp/htdocs/pytest/'
Filename: 'C:/xampp/htdocs/pytest/mptest.py'
PathInfo: ''
Phase: 'PythonHandler'
Handler: 'mptest'
Traceback (most recent call last):
File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1202, in _process_target
module = import_module(module_name, path=path)
File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 296, in import_module
log, import_path)
File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 680, in import_module
execfile(file, module.__dict__)
File "C:\xampp\htdocs\pytest\mptest.py", line 3
def handler(req):
^
IndentationError: unexpected indent
MODULE CACHE DETAILS
Accessed: Fri Dec 12 16:42:32 2008
Generation: 0
_mp_09e1569337f9cf8f743a34267c5946d8 {
FileName: 'C:\\xampp\\htdocs\\pytest\\mptest.py'
Instance: 1 [IMPORT]
Generation: 0 [ERROR]
Modified: Fri Dec 12 15:45:00 2008
}
Mal abgesehen von dem "IndentationError" habe ich eine falsche mod_python_Version installiert?
Viele Grüße
Ernst