royplaygame 发表于 2014-03-20 18:58

mod_python 安装出错,请高手指点

我想安装Apahe+svn+Trac,其它的一切顺利,但就是安装mod_python报错,怎么都解决不了,请高手帮忙。谢谢!
环境版本如下:
# rpm -qa | grep httpd
httpd-tools-2.2.15-29.el6.centos.x86_64
httpd-devel-2.2.15-29.el6.centos.x86_64
httpd-2.2.15-29.el6.centos.x86_64
# rpm -qa | grep subversion
subversion-1.6.11-10.el6_5.x86_6

安装mod_python-3.3.1,在编译的时候出错。错误信息如下:
# ./configure --prefix=/usr/local/mod_python/
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for ar... ar
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... no
checking for main in -lm... yes
checking for an ANSI C-conforming const... yes
checking your blood pressure... a bit high, but we can proceed
configure: checking whether apxs is available...
checking for --with-apxs... no
checking for apxs in /usr/local/apache/sbin... no
checking for apxs in your PATH... checking for apxs... /usr/sbin/apxs
found /usr/sbin/apxs, we'll use this. Use --with-apxs to specify another.
checking Apache version... 2.2.15
checking for Apache libexec directory... /usr/lib64/httpd/modules
checking for Apache include directory... -I/usr/include/httpd
checking for --with-python... no
checking for python... /usr/bin/python
checking Python version... 2.6
checking Python install prefix... /usr
checking checking where python libraries are installed... /usr/lib64/python2.6
checking for Py_NewInterpreter in -lpython2.6... no
configure: error: Can not link to python
#

一直找不到解决办法,谢谢各位了!

timespace 发表于 2014-03-20 21:03

有安装Python 3.3吗?

q1208c 发表于 2014-03-21 07:42

需要 python-devel-2.6 的包.

royplaygame 发表于 2014-03-21 08:28

回复 2# timespace


# rpm -qa | greppython
python-setuptools-0.6.10-3.el6.noarch
python-libs-2.6.6-52.el6.x86_64
python-iniparse-0.3.1-2.1.el6.noarch
python-pycurl-7.19.0-8.el6.x86_64
newt-python-0.52.11-3.el6.x86_64
python-2.6.6-52.el6.x86_64
rpm-python-4.8.0-32.el6.x86_64
python-urlgrabber-3.9.1-8.el6.noarch
libproxy-python-0.3.0-4.el6_3.x86_64
#

    安装了,python2.6.6

royplaygame 发表于 2014-03-21 08:34

回复 3# q1208c



:D 多谢多谢! yum install python-devel 后编译通过了!

royplaygame 发表于 2014-03-21 08:41

另外之后make时遇到 了这个错:
..................................................
                from connobject.c:30:
/usr/include/python2.6/pyconfig-64.h:1043:1: warning: "_XOPEN_SOURCE" redefined
In file included from /usr/include/sys/types.h:26,
               from /usr/include/apr-1/apr-x86_64.h:127,
               from /usr/include/apr-1/apr.h:19,
               from /usr/include/httpd/ap_config.h:25,
               from /usr/include/httpd/httpd.h:43,
               from /home/mod_python-3.3.1/src/include/mod_python.h:42,
               from connobject.c:30:
/usr/include/features.h:164:1: warning: this is the location of the previous definition
connobject.c: In function 鈥榑conn_read鈥?
connobject.c:142: error: request for member 鈥榥ext鈥?in something not a structure or union
apxs:Error: Command failed with rc=65536
.
make: *** Error 1
make: Leaving directory `/home/mod_python-3.3.1/src'
make: *** Error 2
#

vi /src/connobject.c
将src目录的connobject.c中的
  !(b == APR_BRIGADE_SENTINEL(b) ||
  替换为
  !(b == APR_BRIGADE_SENTINEL(bb) ||

再make,就可以成功了。
然后make install.
页: [1]
查看完整版本: mod_python 安装出错,请高手指点