这是一个问题的延续,但它已经偏离了,所以我开始了一个新的问题。我想用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

我已经将wsgipythonpath设置为匹配python shell中sys.path给我的内容:
WSGIPythonPath /System/Library/Frameworks/Python.framework/Versions/2.5

还是没有运气。思想?

最佳答案

根据使用的mod_wsgi版本,应该使用以下指令
对于mod_wsgi 1.x:

WSGIPythonExecutable /path/to/python/2.5/exe

对于mod_wsgi 2.x:
WSGIPythonHome /path/to/python/2.5/exe/directory

WSGIPythonPath只是为了在wsgi上下文中将您自己的库添加到python路径中。
文档链接:http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPythonExecutable

10-06 00:39