我遇到了一个问题,我在这里描述了 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 以前的安装吗?我不知道这是否可以解决问题。
最佳答案
最后删除了/usr/local/lib 内容并重建 python 和 mod_wsgi
关于python - 重新构建 Python 和 mod_wsgi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28681398/