+ -
当前位置:首页 → 问答吧 → 安装mod python时,出现如下错误.请各位帮帮忙...谢谢 

安装mod python时,出现如下错误.请各位帮帮忙...谢谢 

时间:2011-06-29

来源:互联网

软件版本:
python-2.6msi
mod_python-3.3.1.win32-py2.6-apache2.2.exe
apache_2.2.14-win32-x86-no_ssl.msi

httpd.conf配置:
<Directory "D:/website/python">
  AddHandler mod_python .py
  PythonHandler fetchpage
  PythonDebug On
  PythonPath "sys.path+['D:\\website\\python']"
  #这里是网上找到解决方案说需要加上 PyahonPath
</Directory>

在modules 目录下也有mod_python.so这个文件
在python中也发现加载到了 mod_python 这个包


运行时提示错误:


MOD_PYTHON ERROR

ProcessId: 3232
Interpreter: '10.8.8.246'

ServerName: '10.8.8.246'
DocumentRoot: 'D:/website'

URI: '/python/fetchpage.py'
Location: None
Directory: 'D:/website/python/'
Filename: 'D:/website/python/fetchpage.py'
PathInfo: ''

Phase: 'PythonHandler'
Handler: 'fetchpage'

Traceback (most recent call last):

  File "D:\Python26\lib\site-packages\mod_python\importer.py", line 1537, in HandlerDispatch
  default=default_handler, arg=req, silent=hlist.silent)

  File "D:\Python26\lib\site-packages\mod_python\importer.py", line 1206, in _process_target
  object = apache.resolve_object(module, object_str, arg, silent=silent)

  File "D:\Python26\lib\site-packages\mod_python\apache.py", line 696, in resolve_object
  raise AttributeError, s

AttributeError: module 'D:\website\python\fetchpage.py' contains no 'handler'


MODULE CACHE DETAILS

Accessed: Wed Jun 29 09:40:42 2011
Generation: 0

_mp_724a9517053291670d8bf23f2cc9d994 {
  FileName: 'D:\\website\\python\\fetchpage.py'
  Instance: 1 [IMPORT]
  Generation: 1
  Modified: Tue Jun 28 15:43:56 2011
  Imported: Wed Jun 29 09:40:42 2011
}

最开始安装的是
软件版本:
python-2.5msi
mod_python-3.3.1.win32-py2.5-apache2.2.exe
apache_2.2.14-win32-x86-no_ssl.msi

发现不行,然后换现在的版本还是不行。

在网上搜索了很多信息,发现很多人也有过类似的问题,也很多人都一次安装成功。

谁能帮忙解决下,感激不尽。

作者: cuidenghong123   发布时间: 2011-06-29

[Wed Jun 29 10:00:33 2011] [error] [client 127.0.0.1] mod_python (pid=3232, interpreter='10.8.8.246', phase='PythonHandler', handler='fetchpage'): Application error
[Wed Jun 29 10:00:33 2011] [error] [client 127.0.0.1] ServerName: '10.8.8.246'
[Wed Jun 29 10:00:33 2011] [error] [client 127.0.0.1] DocumentRoot: 'D:/website'
[Wed Jun 29 10:00:33 2011] [error] [client 127.0.0.1] URI: '/python/fetchpage.py'
[Wed Jun 29 10:00:33 2011] [error] [client 127.0.0.1] Location: None
[Wed Jun 29 10:00:33 2011] [error] [client 127.0.0.1] Directory: 'D:/website/python/'
[Wed Jun 29 10:00:33 2011] [error] [client 127.0.0.1] Filename: 'D:/website/python/fetchpage.py'
[Wed Jun 29 10:00:33 2011] [error] [client 127.0.0.1] PathInfo: ''
[Wed Jun 29 10:00:33 2011] [error] [client 127.0.0.1] Traceback (most recent call last):
[Wed Jun 29 10:00:33 2011] [error] [client 127.0.0.1] File "D:\\Python26\\lib\\site-packages\\mod_python\\importer.py", line 1537, in HandlerDispatch\n default=default_handler, arg=req, silent=hlist.silent)
[Wed Jun 29 10:00:33 2011] [error] [client 127.0.0.1] File "D:\\Python26\\lib\\site-packages\\mod_python\\importer.py", line 1206, in _process_target\n object = apache.resolve_object(module, object_str, arg, silent=silent)
[Wed Jun 29 10:00:33 2011] [error] [client 127.0.0.1] File "D:\\Python26\\lib\\site-packages\\mod_python\\apache.py", line 696, in resolve_object\n raise AttributeError, s
[Wed Jun 29 10:00:33 2011] [error] [client 127.0.0.1] AttributeError: module 'D:\\website\\python\\fetchpage.py' contains no 'handler'


这是apache的 错误日志

作者: cuidenghong123   发布时间: 2011-06-29

作者: tcwsyt   发布时间: 2011-06-29

热门下载

更多