Apache安装; libpcre错误

问题描述 投票:43回答:7

在Ubuntu 11.10上安装Apache时,出现以下错误:

configure:错误:找不到APR。请阅读文档。

我按照here的说明,然后,我得到以下错误:

configure:error:找不到libpcre的pcre-config。 PCRE是必需的,可从http://pcre.org/获得

我做错了什么,如何解决?

apache pcre
7个回答
86
投票

1.从PCRE.org下载PCRE

2.用前缀编译并安装它:

./configure --prefix=/usr/local/pcre
make
make install

3.返回Apache安装的位置并使用PCRE编译Apache:

--with-pcre=/usr/local/pcre

18
投票

对我来说(Fedora Linux),只需安装pcre-devel就足够了:yum install -y pcre-devel。之后甚至不必使用--with-pcre


4
投票

Debian的

在Debian 9.5的干净安装中,在安装Apache期间,必须有一些软件包和库来避免错误。接下来,我将展示错误类型及其各自的解决方案

组态

  • configure:error:在$ PATH中找不到可接受的C编译器 $ sudo apt-get install build-essential
  • configure:error:找不到libpcre的pcre-config。 PCRE是必需的,可从http://pcre.org/获得 $ sudo apt-get install libpcre3-dev

然后我进行配置,表明它安装在路径/usr/local而不是/usr/local/apache2,否则我将有库错误。想法是在/usr/local/lib中为httpd结束创建的库,以便dynamic linker知道它们。

$ configure --prefix /usr/local

汇编

对于编译,下面安装一些软件包也可以避免我们在Debian的干净安装中出错。

  • xml / apr_xml.c:35:19:致命错误:expat.h:没有这样的文件或目录。 $ sudo apt-get install libexpat1-dev

建议使用-j3参数使编译更快。虽然它也可以被忽略。

$ make -j3

3
投票

我在使用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


1
投票

在RHEL 3中没有必要设置参数--with-pcre指向pcre-config。只需要pcre路径

我的configure命令:

./configure --prefix=/usr/local/apache2 --with-pcre=/usr/local/pcre

0
投票

这对我有用

./configure --prefix / u01 / apache --with-included-apr --with-pcre = / usr / local / pcre / bin / pcre2-config


0
投票

顺便说一句,在构建httpd之前在CentOS 7.6上,请安装pcre-devel

`$ sudo yum install pcre-devel` 
© www.soinside.com 2019 - 2024. All rights reserved.