重建Python和mod_wsgi

时间:2015-02-23 19:03:53

标签: python django python-2.7 rhel

我遇到了一个问题,我在这里描述mod_wsgi Apache error with django app

最后我到了需要重建mod_wsgi的地步。

服务器是RHEL 6,所以默认安装了python 2.6,为了运行一些东西另外管理员安装python 2.7另外

现在,我有这个问题

/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC

根据https://code.google.com/p/modwsgi/wiki/InstallationIssues我遇到的问题是编译为32位的python和mod_wsgi到64之间的冲突

按照本指南https://www.fir3net.com/Programming/Python/how-do-i-compile-modwgsi-for-python-27.html(以及其他人),我尝试使用--enabled-shared重建Python2.7,但在运行make时遇到了同样的错误

/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

Python build finished, but the necessary bits to build these modules were not found:
bsddb185           dl                 imageop         

我不知道问题是否是之前安装的python 2.7。有一种安全的方法来删除整个python 2.7以前的安装?我不知道这是否可以解决问题。

1 个答案:

答案 0 :(得分:1)

最后删除了/ usr / local / lib内容并重建了python和mod_wsgi