Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
601 views
in Technique[技术] by (71.8m points)

apache - mod_wsgi and multiple installations of python

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

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

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

Still no luck. Ideas?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

For mod_wsgi 1.x:

WSGIPythonExecutable /path/to/python/2.5/exe

For mod_wsgi 2.x:

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

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

Link to documentation: http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPythonExecutable


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...