python - mod_wsgi 和 python 的多个安装

标签 python apache mod-wsgi

这是 this 的延续问题,但它已经偏离了,所以我开始了一个新的。我想使用 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 以匹配 sys.path 在 python shell 中给我的内容:

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

关于python - mod_wsgi 和 python 的多个安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6450459/

相关文章:

python - 使用 ng-flow 上传到 gae blobstore 的文件总是命名为 'blob'

Linux Apache : what is the difference of DocumentRoot"path"and <Directory "path">?

Apache 突然打不开任何东西。不超时继续加载

python - 一个 wsgi 应用程序吞噬了所有 apache 客户端

apache - 试图在 Apache : error 13 (search permissions missing) 上运行 Flask

python - Pyinstaller & 键盘

python - Flask 应用程序内存泄漏与 sql 炼金术

python - "This session is in ' 在线程 mod_wsgi 应用程序中使用 scoped_session 准备 ' state; no further"错误与 SQLAlchemy

python - 如何在 python 中只打印第一个值

php - htaccess 301 重定向无法正常工作