【问题标题】:CentOS 6.5, mod_wsgi, Apache Cannot load mod_wsgi.so into server, undefined symbol: PyExc_StopIterationCentOS 6.5,mod_wsgi,Apache 无法将 mod_wsgi.so 加载到服务器中,未定义符号:PyExc_StopIteration
【发布时间】:2014-05-17 07:15:50
【问题描述】:

问题:

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

httpd:/etc/httpd/conf/httpd.conf 第 202 行的语法错误:无法将 /etc/httpd/modules/mod_wsgi.so 加载到服务器中:/etc/httpd/modules/mod_wsgi.so:未定义符号: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 有帮助)

制作

---大量警告---

进行安装

解决方案:


由于我无法回答自己的问题“直到 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

【问题讨论】:

  • 将其更改为“-python3.3”是完全错误的。不要这样做。放回去再试一次。确保在目录中运行“make distclean”并在再次运行 make 之前重新运行 configure。
  • @GrahamDumpleton,然后失败:(将 [newline] 读取为 \n,我无法在注释中很好地格式化代码)---大量警告--- [换行符]/usr/lib64/apr-1/build/libtool --silent --mode=link gcc -o mod_wsgi.la -rpath /usr/lib64/httpd/modules -module -avoid -version mod_wsgi.lo -L /usr/local/lib -L/usr/local/lib/python3.3/config -lpython3.3 -lpthread -ldl -lutil -lm [newline]/usr/bin/ld: 找不到 -lpython3.3 [newline ]collect2: ld 返回 1 个退出状态 [newline]apxs:Error: Command failed with rc=65536 [newline]。 [newline]make: *** [mod_wsgi.la] 错误 1

标签: apache2 mod-wsgi python-3.3 centos6


【解决方案1】:

对编译过程不太熟悉,我已经开始查看参数了......并且没有文件夹“/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

【讨论】:

  • 是的,当 Python 的安装将 ABIFLAG 合并到目录和库版本中时,您需要在 mod_wsgi 的最新正式版本中执行此操作。它已经为 mod_wsgi 的未来版本修复,无论何时发布。
  • @GrahamDumpleton 你指的是什么未来版本?
  • 你试过最新版本吗?一年多以前就修好了。
猜你喜欢
  • 2015-07-15
  • 2015-10-14
  • 2015-02-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-05-24
  • 1970-01-01
  • 2015-11-01
相关资源
最近更新 更多