在 Centos 4.x 上安装 Python 2.4 或更新版本

在 Centos 4.x 上安装 Python 2.4 或更新版本

我想在 CentOS 4.7 上运行的 Django 应用程序中使用 Python 2.4 功能。Python 的默认版本是 2.3,我认为最好不要尝试替换它。有没有办法同时安装较新版本的 Python,并以某种方式告诉 Apache 将其用于 mod_python?

答案1

是的,只需构建自己的 Python 并将其放在其他地方(例如 /opt 或 /usr/local)。您需要重建 mod_python,然后您就可以指定新的 python 位置。

./configure --with-python=/path/to/python2.4

答案2

这里有一篇很好的文章,介绍了如何使用哪些选项配置 Python 以将其安装到不同的目录中 http://binarysushi.com/blog/2009/aug/19/CentOS-5-3-python-2-5-virtualevn-mod-wsgi-and-mod-rpaf/

相关内容