CentOS 6.5,mod_wsgi,Apache无法将mod_wsgi.so加载到服务器,未定义的符号:PyExc_StopIteration

时间:2014-04-04 19:52:35

标签: apache2 mod-wsgi python-3.3 centos6

问题:

我无法使用mod_wsgi启动apache服务器。 apachectl -t 说:

httpd:/etc/httpd/conf/httpd.conf第202行的语法错误:无法将/etc/httpd/modules/mod_wsgi.so加载到服务器:/etc/httpd/modules/mod_wsgi.so:unfined defined symbol : PyExc_StopIteration

这是我到目前为止所得到的:

Server version: Apache/2.2.15 (Unix)  
Python 3.3.5
mod_wsgi-3.4 (latest)

python编译:

wget http://python.org/ftp/python/3.3.5/Python-3.3.5.tar.xz
tar xf Python-3.3.5.tar.xz
cd Python-3.3.5
./configure --prefix=/usr/local --enable-shared --with-threads
make && make altinstall

mod_wsgi编译:

./ configure --with-python = / usr / local / bin / python3.3

checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking Apache version... 2.2.15
configure: creating ./config.status
config.status: creating Makefile

然后我编辑Makefile - 替换:

LDLIBS =  -lpython3.3 -lpthread -ldl  -lutil -lm

LDLIBS =  -python3.3 -lpthread -ldl  -lutil -lm

(对不起,我不记得我在哪里读过这篇文章了,但是上次我成功地在相同的系统配置上安装了mod_wsgi这对我有帮助)

---大量警告---

make install

解:


因为我无法回答我自己的问题“直到8声望”,我才会编辑自己的帖子。


熟悉编译过程不是太多,我已经开始研究参数......并且没有文件夹“/usr/local/lib/python3.3/config”!随着猜测,我对生成的Makefile进行了下一次更改,现在它可以工作了!

< LDFLAGS = -L/usr/local/lib -L/usr/local/lib/python3.3/config

< LDLIBS = -lpython3.3 -lpthread -ldl -lutil -lm

------------

> LDFLAGS = -L/usr/local/lib -L/usr/local/lib/python3.3/config-3.3m

> LDLIBS = -lpython3.3m -lpthread -ldl -lutil -lm

1 个答案:

答案 0 :(得分:0)

熟悉编译过程不是太多,我已经开始研究参数......并且没有文件夹“/usr/local/lib/python3.3/config”!随着猜测,我对生成的Makefile进行了下一次更改,现在它可以工作了!

< LDFLAGS = -L/usr/local/lib -L/usr/local/lib/python3.3/config

< LDLIBS = -lpython3.3 -lpthread -ldl -lutil -lm

------------

> LDFLAGS = -L/usr/local/lib -L/usr/local/lib/python3.3/config-3.3m

> LDLIBS = -lpython3.3m -lpthread -ldl -lutil -lm