python - Mod_Wsgi PythonHome 不工作

标签 python django ubuntu mod-wsgi wsgi

所以我错误地运行了 Ubuntu Server (12.04)。我安装了 Python3 和 mod_wsgi 的 python3 版本。

Apache2 启动 - 但留下以下错误日志:

[Mon May 05 11:00:24 2014] [error] python_init: Python version mismatch, expected '2.7.2+', found '2.7.3'.
[Mon May 05 11:00:24 2014] [error] python_init: Python executable found '/usr/bin/python'.
[Mon May 05 11:00:24 2014] [error] python_init: Python path being used '/usr/lib/python2.7/:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/$
[Mon May 05 11:00:24 2014] [notice] mod_python: Creating 8 session mutexes based on 80 max processes and 0 max threads.
[Mon May 05 11:00:24 2014] [notice] mod_python: using mutex_directory /tmp
[Mon May 05 11:00:24 2014] [warn] mod_wsgi: Compiled for Python/3.2.2+.
[Mon May 05 11:00:24 2014] [warn] mod_wsgi: Runtime using Python/2.7.3.
[Mon May 05 11:00:24 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.11 with Suhosin-Patch mod_python/3.3.1 Python/2.7.3 mod_wsgi/3.3 configured$
[Mon May 05 11:00:25 2014] [notice] child pid 10860 exit signal Segmentation fault (11)
[Mon May 05 11:00:25 2014] [notice] child pid 10861 exit signal Segmentation fault (11)
[Mon May 05 11:00:25 2014] [notice] child pid 10863 exit signal Segmentation fault (11)
[Mon May 05 11:00:27 2014] [notice] child pid 10864 exit signal Segmentation fault (11)
[Mon May 05 11:00:27 2014] [notice] child pid 10865 exit signal Segmentation fault (11)

这是我的 WSGI.conf

<IfModule mod_wsgi.c>

WSGIPythonHome /usr/bin/python3.2
WSGIPythonPath /home/user/.virtualenvs/my_env/lib/python3.2/site-packages/

</IfModule>

我在 2 个小时的谷歌搜索中一无所获 - 所以我很想安装一个不同的服务器操作系统,但重新上传/重新解析比特币区 block 链至少需要一天时间。

最佳答案

WSGIPythonHome 不会做任何事情,因为您还将 mod_python 加载到您的 Apache 实例中。在这种情况下,mod_python 会覆盖正在使用的 Python 版本。

WSGIPythonHome 的文档中提到了这一点。

另请阅读:

此外,无论如何,WSGIPythonHome 并不意味着要设置为 Python 可执行文件的路径。因此,即使您只使用了 mod_wsgi,也会被完全忽略。

因此,如果您不需要 mod_python,请停止将其加载到 Apache 中。

关于python - Mod_Wsgi PythonHome 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23471212/

相关文章:

python - 如何规范化 Python 中的位置名称?

python - 使用 pip 安装 Spacy 期间出错

python - 如何将 config.py 中的 Python 参数传递给 .sql 文件?

python pandas OLS.predict,正确的签名是什么?

Django 序列化程序不存在 'geojson' ?

python - 将无数据库字段模型添加到 django 序列化 JSON

python - Django 2.0 试图用正则表达式获取主键但我得到 404

python - "Solver did not exit normally"- Jupyter/Python3/Ubuntu

ubuntu - HADOOP - 权限被拒绝执行 start-all.sh

linux - 如何使用自定义命令在 PM2 中启动进程