在Ubuntu 11.10上安装Apache时,出现以下错误:
configure:错误:找不到APR。请阅读文档。
我按照here的说明,然后,我得到以下错误:
configure:error:找不到libpcre的pcre-config。 PCRE是必需的,可从http://pcre.org/获得
我做错了什么,如何解决?
1.从PCRE.org下载PCRE
2.用前缀编译并安装它:
./configure --prefix=/usr/local/pcre
make
make install
3.返回Apache安装的位置并使用PCRE编译Apache:
--with-pcre=/usr/local/pcre
对我来说(Fedora Linux),只需安装pcre-devel就足够了:yum install -y pcre-devel
。之后甚至不必使用--with-pcre
。
在Debian 9.5的干净安装中,在安装Apache期间,必须有一些软件包和库来避免错误。接下来,我将展示错误类型及其各自的解决方案
组态
$ sudo apt-get install build-essential
$ sudo apt-get install libpcre3-dev
然后我进行配置,表明它安装在路径/usr/local
而不是/usr/local/apache2
,否则我将有库错误。想法是在/usr/local/lib
中为httpd结束创建的库,以便dynamic linker知道它们。
$ configure --prefix /usr/local
汇编
对于编译,下面安装一些软件包也可以避免我们在Debian的干净安装中出错。
$ sudo apt-get install libexpat1-dev
。建议使用-j3参数使编译更快。虽然它也可以被忽略。
$ make -j3
我在使用pcre在CentOS中编译apache2时遇到了其他问题。我在其他位置安装了pcre“/ custom / location / pcre”并且configure命令抛出以下错误
configure: error: Did not find pcre-config script at "/custom/location/pcre"
解决它将国旗--with-pcre=/custom/location/pcre
改为--with-pcre=/custom/location/pcre/bin/pcre2-config
在RHEL 3中没有必要设置参数--with-pcre
指向pcre-config。只需要pcre
路径
我的configure命令:
./configure --prefix=/usr/local/apache2 --with-pcre=/usr/local/pcre
这对我有用
./configure --prefix / u01 / apache --with-included-apr --with-pcre = / usr / local / pcre / bin / pcre2-config
顺便说一句,在构建httpd之前在CentOS 7.6上,请安装pcre-devel
`$ sudo yum install pcre-devel`