当我尝试在Apache中使用Python Server Pages和Mod_Python时,我收到这个错误:
File "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 1229, in _
我安装了mod_python,尝试运行python脚本,如下所示:
from mod_python import apache
它向我显示错误消息:
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
from mod_python import apache
File "D:\Python27\lib\mod_python\apache.py", line 55, in <module>
import _
我一直在Apache日志中获取这些错误:
[error] python_init: Python version mismatch, expected '2.6.5+', found '2.6.6'.
[error] python_init: Python executable found '/usr/bin/python'.
[error] python_init: Python path being used '/usr/lib/python2.6/:/usr/lib/python2.6/plat-linux2:/usr/lib/py
当我启动apache时,我会得到这些错误:
[Tue Jun 14 02:28:58 2011] [error] python_init: Python version mismatch, expected '2.6.5', found '2.6.6'.
[Tue Jun 14 02:28:58 2011] [error] python_init: Python executable found '/usr/bin/python'.
[Tue Jun 14 02:28:58 2011] [error] python_init: Python pa
我正在尝试运行我下载的python程序。它需要mod_python,所以我从源代码安装了最新版本。
我也在Ubuntu 12.04上运行Python 2.7。
当我运行python文件时,我得到以下错误:
from mod_python import apache
File "/usr/local/lib/python2.7/dist-packages/mod_python/apache.py", line 30, in <module>
import _apache
ImportError: No module named _apache
这个错误似乎
我在从apache配置中获取环境变量时遇到了问题。(不要问为什么要这样做,我最初不是在编写代码)
这是我在apache配置中的配置。
<Location "/var/www">
SetHandler python-program
PythonHandler mod_python.publisher
PythonOption MYSQL_PWD ###########
PythonDebug On
</Location>
这是问题代码..。
#this is the problem code in question.
def
我在/var/www上有一个test.py文件,我正在使用ubuntu10.10上的apache2。我安装了mod_python,并将/etc/apache2/sites-available/default配置为
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride AuthConfig
Order allow,deny
allow from all
AddHandler mod_python .py
PythonHandler m