我如何告诉 Phusion Passenger 使用哪个 python?

2024-02-08

我将 Phusion Passenger 与 ruby​​ 应用程序一起使用,我还想将其设置为与我正在开发的 django appengine 应用程序一起使用。

谷歌搜索“passenger_wsgi.py”我能够得到以下非常简单的非 django 应用程序,用于乘客:

Passenger_wsgi.py:

def application(environ, start_response):
   response_headers = [('Content-type','text/plain')]
   start_response('200 OK', response_headers)
   return ['Hello World!\n']

但是,如果我添加行import django.core.handlers.wsgi混合后,我收到“导入您的passenger_wsgi.py时发生错误”。通过打印 sys.path 我发现至少部分原因是因为 Passenger 在我的机器上使用了错误的 python 安装。

我如何配置 Passenger(在 apache 上)以使用/opt/local/bin/python2.5而不是系统默认的python?


您可以通过以下方式指定 python 解释器PassengerPython服务器配置、虚拟主机、目录或 .htaccess 文件中的变量。

apache: 乘客蟒蛇 https://www.phusionpassenger.com/library/config/apache/reference/#passengerpython

nginx: 乘客蟒蛇 https://www.phusionpassenger.com/library/config/nginx/reference/#passenger_python

独立:--python https://www.phusionpassenger.com/library/config/standalone/reference/#--python-python

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

我如何告诉 Phusion Passenger 使用哪个 python? 的相关文章

随机推荐