xxqyzsc 发表于 2018-11-20 09:00:00

源码编译安装apache报APR错及解决方案

问题:
源码编译安装apache是报下面错误:
#./configure --prefix……检查编辑环境时出现
checking for APR... no
configure: error: APR not found.Please read the documentation.
可以用./configure –help | grep apr 查看帮助。
--with-included-apr   Use bundled copies of APR/APR-Util
--with-apr=PATH         prefix for installed APR or the full path to apr-config
--with-apr-util=PATH    prefix for installed APU or the full path to
安装APR(Apache Portable Runtime )
下载:http://apr.apache.org/download.cgi

[*]#wget http://mirrors.hust.edu.cn/apache//apr/apr-1.5.2.tar.gz
[*]#tar -zxvf apr-1.5.2.tar.gz
[*]#cd apr-1.5.2
[*]# ./configure --prefix=/usr/local/apr
[*]#make &&make install
再次检查编译环境出现
checking for APR-util... no
configure: error: APR-util not found .Please read the documentation.

[*]#wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.5.4.tar.gz
[*]#tar -zxvf apr-util-1.5.4.tar.gz
[*]#cd apr-util-1.5.4
[*]#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr   (--with-apr=/usr/local/apr是一定要加的,否则报错)
[*]#make && make install

再次检查编译环境出现:
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

[*]#wget https://sourceforge.net/projects/pcre/files/pcre/8.35/pcre-8.35.tar.gz
[*]#tar -xzvf pcre-8.35.tar.gz
[*]#cd pcre-8.35
[*]#./configure --prefix=/usr/local/pcre
[*]#make &&make install


再次检查编译环境出现
checking whether to enable mod_deflate... checking dependencies
checking for zlib location... not found
checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
解决方法:
yum install zlib-devel -y

继续安装apache,./configure 时加上参数 --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre,之后make&&make install
  




页: [1]
查看完整版本: 源码编译安装apache报APR错及解决方案