更改 Fast CGI 以运行不同版本的 python
我通过 Hostmonster 有一个共享网络服务器。我正在尝试使用 python 2.6 安装和运行 Django,但是虽然他们安装了 2.6,但它不是默认的 python 版本。默认版本是python 2.4.3,我已经安装了所有依赖项和Django,但是fcgi脚本仍然通过python 2.4运行。有什么办法可以强制 fcgi 脚本运行 2.6 吗?
i have a shared web server through Hostmonster. I am trying to install and run Django using python 2.6, however while they have 2.6 installed it is not the default python version. The default version is python 2.4.3, I have installed all the dependencies and Django, however the fcgi script still runs through python 2.4. Is there any way that i can force the fcgi script to run 2.6?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我的系统上托管在tigertech.net(一个非常普通的托管服务)上,我使用来自
http://www.codekoala.com/blog/2008/installing-django-shared-hosting-site5/
你只需要确保“she-bang “(.fcgi 文件中的第一行)正确标识了您要运行的 python 版本。
假设 2.6 安装位于 /usr/bin/python26/ 中,那么您将拥有
fcgi 文件的第一行,而不是现在的任何内容。这告诉服务器您希望脚本在哪个版本的 python(或其他版本)下运行。
On my system which is hosted on tigertech.net (a pretty vanilla hosting service), I configured using excellent advice from
http://www.codekoala.com/blog/2008/installing-django-shared-hosting-site5/
You just need to make sure that the "she-bang" (first line in the .fcgi file) correctly identifies the version of python you want to run.
Assuming that the 2.6 install is located in /usr/bin/python26/, you would then have
as the first line of your fcgi file, instead of whatever you have right now. That tells the server which version of python (or whatever) you want the script to be run under.