尝试设置mod_python时出错

时间:2013-05-24 11:41:00

标签: python apache apache2 mod-python linuxmint

安装mod_python并更改

/etc/apache2/sites-available/default
文件后。当我尝试运行

时出现以下错误
tail -f /var/log/apache2/error.log
ai-System-Product-Name ws_code # tail -f /var/log/apache2/error.log
Fatal Python error: PyEval_AcquireThread: NULL new thread state
Fatal Python error: PyEval_AcquireThread: NULL new thread state
Fatal Python error: PyEval_AcquireThread: NULL new thread state
Fatal Python error: PyEval_AcquireThread: NULL new thread state
Fatal Python error: PyEval_AcquireThread: NULL new thread state
Fatal Python error: PyEval_AcquireThread: NULL new thread state
[Fri May 24 16:45:29 2013] [notice] caught SIGTERM, shutting down
[Fri May 24 16:45:30 2013] [notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads.
[Fri May 24 16:45:30 2013] [notice] mod_python: using mutex_directory /tmp 
[Fri May 24 16:45:30 2013] [notice] Apache/2.2.22 (Ubuntu) PHP/5.4.6-1ubuntu1.2 mod_python/3.3.1 Python/2.7.3 mod_wsgi/3.4 configured -- resuming normal operations

此外,每当我尝试在浏览器上运行我的代码时,它只是直接显示原始代码。如何删除错误?我正在使用Linux Mint 14 Nadia。

1 个答案:

答案 0 :(得分:1)

不再开发或支持mod_python包,并且多年来一直没有更新。如果它仍然适用于最新的Python 2.X版本,那么你会很幸运。 mod_python包不能正确使用Python线程API。在Python 3.X中,他们改变了使用线程API的义务。如果其中任何一个被重新移植到Python 2.7,那么mod_python可能会因为其错误的线程API使用而中断。

简短的回答是,你最近不想使用mod_python。