CentOS 6.5, mod_wsgi, Apache Cannot load mod_wsgi.so into server, undefined symbol: PyExc_StopIteration

StackOverflow https://stackoverflow.com/questions/22871871

Question

The problem:

I can't start apache server with mod_wsgi. apachectl -t says:

httpd: Syntax error on line 202 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_wsgi.so into server: /etc/httpd/modules/mod_wsgi.so: undefined symbol: PyExc_StopIteration

Here's what I got so far:

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

python compilation:

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 compilation:

./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

then I edit Makefile - replace:

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

with

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

(sorry, I can't remember where I've read this, but it helps me last time I sucessfully install mod_wsgi on same system configuration)

make

---plenty of warnings---

make install

SOLUTION:


since I can't answer my own question "till 8 reputation", I gonna edit my own post.


Being familiar with compilation process not too much, I've started looking into parameters... and there were no folder "/usr/local/lib/python3.3/config"! With a wild guess, I made next changes to generated Makefile, and now it works!

< 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

Was it helpful?

Solution

Being familiar with compilation process not too much, I've started looking into parameters... and there were no folder "/usr/local/lib/python3.3/config"! With a wild guess, I made next changes to generated Makefile, and now it works!

< 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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top