安裝Apache提示APR not found的解決辦法
#./configure --prefix……檢查編輯環境時出現:
checking for APR... noconfigure: 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 ) [root@localhost ~]# cd /tmp/52lamp/ //源碼存放位置[root@localhost 52lamp]# tar -zxvf apr-1.4.2.tar.gz //unzip -o apr-1.4.2.zip[root@localhost 52lamp]# cd apr-1.4.2[root@localhost apr-1.4.2]# ./configure[root@localhost apr-1.4.2]# make[root@localhost apr-1.4.2]# make install
再次檢查編譯環境出現
checking for APR-util... noconfigure: error: APR-util not found . Please read the documentation. [root@localhost httpd-2.2.16]# ./configure –help | grep apr-util--with-apr-util=PATH prefix for installed APU or the full path to [root@localhost 52lamp]# tar -zxvf apr-util-1.3.9.tar.gz[root@localhost 52lamp]# cd apr-util-1.3.9[root@localhost apr-util-1.3.9]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr[root@localhost apr-util-1.3.9]# make[root@localhost apr-util-1.3.9]# make install
./configure仍提示APR-util not found,增加--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util後出現
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
[root@localhost httpd-2.2.16]# ./configure –help | grep pcre--with-pcre=PATH Use external PCRE library [root@localhost 52lamp]# unzip -o pcre-8.10.zip[root@localhost 52lamp]# cd pcre-8.10[root@localhost cd pcre-8.10]# ./configure --prefix=/usr/local/pcre[root@localhost cd pcre-8.10]# make[root@localhost cd pcre-8.10]# make install
缺少gcc-c++和libtool,也就是c++編譯包
libtool: compile: unrecognized option `-DHAVE_CONFIG_H' libtool: compile: Try `libtool --help' for more information. make[1]: *** [pcrecpp.lo] Error 1 make[1]: Leaving directory `/home/guangbo/work/pcre-8.12' make: *** [all] Error 2
解決方法:需要先安裝libtool和gcc-c++
繼續安裝Apache/httpd,./configure 時加上參數 --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre,這個問題就解決了。