mod_wsgi 和 python 的多个安装 [英] mod_wsgi and multiple installations of python

查看:38
本文介绍了mod_wsgi 和 python 的多个安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

This is kind of a continuation of this question, but it has deviated so I started a new one. I'd like to use Python 2.5 instead of OS X's default 2.6. I've set this up for my terminal and whatnot, but whenever apache runs it gives me the following error output:

[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 中给我的内容:

I've set WSGIPythonPath to match what sys.path gives me in the python shell:

WSGIPythonPath /System/Library/Frameworks/Python.framework/Versions/2.5

仍然没有运气.想法?

推荐答案

你应该根据你使用的 mod_wsgi 的版本使用以下指令

You should use the following directives depending on which version of mod_wsgi you use

对于 mod_wsgi 1.x:

For mod_wsgi 1.x:

WSGIPythonExecutable /path/to/python/2.5/exe

对于 mod_wsgi 2.x:

For mod_wsgi 2.x:

WSGIPythonHome /path/to/python/2.5/exe/directory

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

The WSGIPythonPath is just intended to add your own libraries to the Python Path in the WSGI context.

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

这篇关于mod_wsgi 和 python 的多个安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆