mod_wsgi和python的多个安装

Bri*_*n D 17 python apache mod-wsgi

这是这个问题的延续,但它已经偏离,所以我开始了一个新问题.我想使用Python 2.5而不是OS X的默认2.6.我已经为我的终端和诸如此类的东西设置了这个,但是每当apache运行时它给我以下错误输出:

[Thu Jun 23 00:01:42 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Jun 23 00:01:42 2011] [warn] mod_wsgi: Compiled for Python/2.5.4.
[Thu Jun 23 00:01:42 2011] [warn] mod_wsgi: Runtime using Python/2.6.1.
[Thu Jun 23 00:01:42 2011] [notice] Digest: generating secret for digest authentication ...
[Thu Jun 23 00:01:42 2011] [notice] Digest: done
[Thu Jun 23 00:01:42 2011] [notice] Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8l DAV/2 mod_wsgi/3.3 Python/2.6.1 configured -- resuming normal operations
Run Code Online (Sandbox Code Playgroud)

我已经设置了WSGIPythonPath以匹配sys.path在python shell中提供的内容:

WSGIPythonPath /System/Library/Frameworks/Python.framework/Versions/2.5
Run Code Online (Sandbox Code Playgroud)

仍然没有运气.想法?

Kal*_*zar 11

您应该使用以下指令,具体取决于您使用的mod_wsgi版本

对于mod_wsgi 1.x:

WSGIPythonExecutable /path/to/python/2.5/exe
Run Code Online (Sandbox Code Playgroud)

对于mod_wsgi 2.x:

WSGIPythonHome /path/to/python/2.5/exe/directory
Run Code Online (Sandbox Code Playgroud)

WSGIPythonPath只是为了在WSGI上下文中将自己的库添加到Python Path中.

链接到文档:http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPythonExecutable


xyz*_*123 4

[Thu Jun 23 00:01:42 2011] [warn] mod_wsgi: Compiled for Python/2.5.4.
[Thu Jun 23 00:01:42 2011] [warn] mod_wsgi: Runtime using Python/2.6.1.
Run Code Online (Sandbox Code Playgroud)

这两行告诉您 mod_wsgi 是为错误的 Python 版本编译的,因此您需要使用正确的--with-python指令重新编译它。请参阅http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide#Configuring_The_Source_Code