./configure CFLAGS=-fPIC && make && make install
编译安装必须添加 CFLAGS=-fPIC,否则在安装mod_python的时候会报错。
错误:/usr/local/lib/python2.6/config/libpython2.6.a: could not read symbols: Bad value
编译安装完后
编译安装,mod_python,指定python版本
./configure --with-python=/usr/local/bin/python2.6
网上推荐用:
./configure --enable-shared
但是这样编译安装完后,在安装mod_python的时候还会报错。
造成这个错误的原因是系统共存多个版本的python,造成python的动态库混乱了。
CFLAGS=-fPIC 是重新根据安装的python编译动态库