分类: Python/Ruby
2012-07-24 23:37:42
wget
tar xzvfmod_python-3.3.1.tgz
cd mod_python-3.3.1
./configure --with-apxs=/usr/local/apache/bin/apxs --with-python=/usr/local/bin/python && make && make install
编译过程钟可能出现下面错误
错误1:
connobject.c: 在函数‘_conn_read’中:
connobject.c:142: 错误: 在非结构或联合中请求成员‘next’
apxs:Error: Command failed with rc=65536
解决方案:
修改src/connobject.c第142行
把!(b == APR_BRIGADE_SENTINEL(b) || 改为!(b == APR_BRIGADE_SENTINEL(bb) ||
错误2:
/usr/local/lib/python2.5/config/libpython2.5.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
解决方案:
首先,确认编译Python的时候有没有加上--enable-shared,如果没有,加上重新编译
此时行Python可能出现以错误
错误2.1
python: error while loading shared libraries: libpython2.7.so.1.0:
cannot open shared object file: No such file or
错误2.1解决方案:
新建下面文件
vim /etc/ld.so.conf.d/python2.7.conf
加入内容:
/usr/local/lib
保存退出后运行:
ldconfig
每次编译mod_python都是一次痛苦的经历,上面解决方案参考:
http://agiletesting.blogspot.com/2007/10/compiling-modpython-on-rhel-64-bit.html