阿里云服务器_下载安装mod_wsgi时编译出错

问题描述:

在使用apache和wsgi部署环境时候,从官网下载压缩包安装mod_wsgi的方式部署,编译出错,如下:

root@iZm5eftx94e1dmwqla5qoxZ:/home/mod_wsgi-4.7.1# ./configure --with-apxs=/usr/bin/apxs --with-python=/usr/lib/python3.6

root@iZm5eftx94e1dmwqla5qoxZ:/home/mod_wsgi-4.7.1# make
/usr/bin/apxs -c  -Wc,-g -Wc,-O2  src/server/mod_wsgi.c src/server/wsgi_*.c -L -L  -lpython
/usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-static i686-linux-gnu-gcc -std=gnu99 -prefer-pic -pipe -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security  -D_FORTIFY_SOURCE=2   -DLINUX -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE  -pthread  -I/usr/include/apache2  -I/usr/include/apr-1.0   -I/usr/include/apr-1.0 -I/usr/include -g -O2  -c -o src/server/mod_wsgi.lo src/server/mod_wsgi.c && touch src/server/mod_wsgi.slo
In file included from src/server/mod_wsgi.c:22:0:
src/server/wsgi_python.h:24:20: fatal error: Python.h: No such file or directory
 #include <Python.h>
                    ^
compilation terminated.
apxs:Error: Command failed with rc=65536
.

原因分析

我的配置地址写错了,python的地址是【/usr/bin/python3.6】不是【/usr/lib/python3.6】

root@iZm5eftx94e1dmwqla5qoxZ:/home/mod_wsgi-4.7.1# whereis apxs
apxs: /usr/bin/apxs /usr/share/man/man1/apxs.1.gz
root@iZm5eftx94e1dmwqla5qoxZ:/home/mod_wsgi-4.7.1# whereis python
python: /usr/bin/python /usr/bin/python3.4m-config /usr/bin/python3.6m-config /usr/bin/python2.7 /usr/bin/python3.6m /usr/bin/python3.4-config /usr/bin/python3.4 /usr/bin/python3.6-config /usr/bin/python2.7-config /usr/bin/python3.6 /usr/bin/python3.4m /etc/python /etc/python2.7 /etc/python3.4 /etc/python3.6 /usr/lib/python2.7 /usr/lib/python3.4 /usr/lib/python3.6 /usr/local/lib/python2.7 /usr/local/lib/python3.4 /usr/local/lib/python3.6 /usr/include/python2.7 /usr/include/python3.6m /usr/include/python3.4 /usr/include/python3.6 /usr/include/python3.4m /usr/share/python /usr/share/man/man1/python.1.gz

正确配置代码:

root@iZm5eftx94e1dmwqla5qoxZ:/home/mod_wsgi-4.7.1# ./configure --with-apxs=/usr/bin/apxs --with-python=/usr/bin/python3.6

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值