使用python2.7在centos中安装mod_wsgi时出错

Mir*_*age 5 python centos mod-wsgi

当我在 mod_wsgi 文件夹中“制作”时,我收到此错误

我使用以下配置

./configure --with-apxs=/usr/local/apache/bin/apxs   --with-python=/opt/python27/bin/python
Run Code Online (Sandbox Code Playgroud)

/usr/bin/ld: /opt/python27/lib/libpython2.7.a(node.o): relocation R_X86_64_32针对`a local symbol'不能在创建共享对象时使用;使用 -fPIC /opt/python27/lib/libpython2.7.a 重新编译:无法读取符号:错误值 collect2:ld 返回 1 退出状态 apxs:错误:命令失败,rc=65536

此链接有解决方案,但我无法完全理解

1)How can i found that i have compiled x32bit or x64 bit version of python 
2)I didn't understand about what symbolic link he was talking about
Run Code Online (Sandbox Code Playgroud)

Gra*_*ton 7

重要的一点是使用 --enable-shared 重建 Python。如果你还没有这样做,符号链接注释是不相关的,甚至不应该适用于最近的 Python/mod_WSGI 版本。

  • 这意味着安装的内容在构建时没有启用共享库支持。确保在重建时先运行 'make distclean',然后再次运行 'configure' 并在 'configure' 的选项中包含 '--enable-shared'。您甚至可以在执行此操作时将“/opt/python2.7”重命名为“/opt/python2.7.static”,以确保它重新创建它并且安装的版本不会导致问题。 (2认同)