mod_python安装过程的问题及解决记录

发布时间:2019-11-14编辑:脚本学堂
编译安装mod_python时,遇到一些问题,经过努力还是解决了,记录在此,以备后阅。

编译安装mod_python时,遇到一些问题,经过努力还是解决了,记录在此,以备后阅。

解压缩后,进入到目录中:
./configure --with-apxs=/usr/local/apache2/bin/apxs
报错:
connobject.c:142: error: request for member ‘next’ in something not a structure or union
apxs:Error: Command failed with rc=65536
.
make[1]: *** [mod_python.so] Error 1
make[1]: Leaving directory `/root/django_python/mod_python-3.3.1/src'
make: *** [do_dso] Error 2

解决方法:
编辑 /root/soft/mod_python-3.3.1/src/connobject.c 的 142 行:
!(b == APR_BRIGADE_SENTINEL(b)
改成:
!(b == APR_BRIGADE_SENTINEL(bb) 即:改成两个b
然后再次执行make

继续出现问题:
/usr/bin/ld: /usr/local/lib/python2.6/config/libpython2.6.a(abstract.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/python2.6/config/libpython2.6.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
.
make[1]: *** [mod_python.so] Error 1
make[1]: Leaving directory `/root/django_python/mod_python-3.3.1/src'
make: *** [do_dso] Error 2

问题解决lib/usr/local/lib/python2.6/config/libpython2.6.a有问题,从其他地方拷贝过来编译成功。

此时如果生成mod_python.so,说明安装完成。