在virtualenv中编译mod_wsgi的问题

Joh*_*n C 6 python mod-wsgi virtualenv

我正在尝试在CentOS服务器上编译mod_wsgi(版本3.3),Python 2.6,但是virtualenv没有成功.我收到错误:

/ usr/bin/ld:/home/python26/lib/libpython2.6.a(node.o):在创建共享对象时,不能使用针对"本地符号"的重定位R_X86_64_32; 用-fPIC重新编译

/home/python26/lib/libpython2.6.a:无法读取符号:值不正确

根据mod_wsgi安装问题文档,它可能是libpython2.6.a文件:

  • 不在那里
  • 没有使用共享生成
  • 是为32位机器而不是64位机器生成的.

好吧,文件在正确的位置,并且可读.我尝试使用该--enable-shared选项重新编译Python 2.6 ,但整个编译爆炸,大约每个文件都给出相同的错误,libpython2.6.a被清除.

我不知道 Python正在编译64位,但是当我运行它时,它做了:

import platform
print platform.platform()
>>>Linux-2.6.18-028stab070.4-x86_64-with-redhat-5.6-Final
Run Code Online (Sandbox Code Playgroud)

由于Python认为它是在x86_64上,我希望它编译为64位 - 如果有人有任何方式确认,我会很感激.

我尝试使用和不使用--python =/home/[...]/python2.6配置mod_wsgi Makefile,两种方式都爆炸了.

我也试过编译mod_wsgi的以外virtualenv,使用Python 2.4,它工作得很好.不幸的是,如果我要使用它,这对我没有帮助virtualenv:)

任何人都知道如何让mod_wsgi在下编译virtualenv

Gra*_*ton 8

文档的相关部分是:

http://modwsgi.readthedocs.io/en/develop/user-guides/installation-issues.html#mixing-32-bit-and-64-bit-packages

这提到了-fPIC问题.

和:

http://modwsgi.readthedocs.io/en/develop/user-guides/installation-issues.html#unable-to-find-python-shared-library

当mod_wsgi找不到共享库时,提到需要使用LD_RUN_PATH.

有关共享库问题以及mod_wsgi在以下位置找到错误的Python安装的问题,可以找到其他信息:

http://modwsgi.readthedocs.io/en/develop/user-guides/checking-your-installation.html#python-shared-library