Myjab
Myjab

Reputation: 944

Apache installation; libpcre error

When installing Apache on Ubuntu 11.10, I get the following error:

configure: error: APR not found. Please read the documentation.

I followed the instructions here, then, I get the error below:

configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

What am I doing wrong and how can I resolve it?

Upvotes: 49

Views: 116891

Answers (8)

Yash Hax
Yash Hax

Reputation: 76

This worked for me: sudo apt-get install libpcre3-dev

In ubuntu

Upvotes: 1

Jacek Przepióra
Jacek Przepióra

Reputation: 21

BTW, on CentOS 7.6 before building httpd, please install pcre-devel

`$ sudo yum install pcre-devel` 

Upvotes: 2

Braian Coronel
Braian Coronel

Reputation: 22867

Debian

In a clean installation of Debian 9.5, during the installation of Apache it is necessary to have some packages and libraries to avoid errors. Next I show the type of error and its respective solution

Configuration

  • configure: error: no acceptable C compiler found in $PATH

    $ sudo apt-get install build-essential

  • configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

    $ sudo apt-get install libpcre3-dev

Then I make the configuration indicating that it is installed in the path /usr/local and not in /usr/local/apache2, otherwise I will have library errors. The idea is that the libraries created for httpd end in /usr/local/lib so that the dynamic linker knows them.

$ configure --prefix /usr/local

Compilation

And for the compilation the following the installation of some packages also would avoid us errors in a clean installation of Debian.

  • xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory.

    $ sudo apt-get install libexpat1-dev.

It is recommended to use the -j3 parameter to make the compilation faster. Although it could also be ignored.

$ make -j3

Upvotes: 10

Suresh Ram
Suresh Ram

Reputation: 107

This worked for me

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

Upvotes: 1

emboss
emboss

Reputation: 39620

For me (Fedora Linux), it was enough to just install the pcre-devel: yum install -y pcre-devel. Didn't even have to use --with-pcre afterwards.

Upvotes: 19

albertoiNET
albertoiNET

Reputation: 1348

In RHEL 3 is not necessary setting parameter --with-pcre pointing to pcre-config. Only need pcre path

My configure command:

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

Upvotes: 1

fhuertas
fhuertas

Reputation: 5473

I was other problem compiling apache2 in CentOS with pcre. I installed pcre in other location "/custom/location/pcre" and configure command throw the following error

configure: error: Did not find pcre-config script at "/custom/location/pcre"

to solve it changing the flag --with-pcre=/custom/location/pcre to --with-pcre=/custom/location/pcre/bin/pcre2-config

Upvotes: 4

WoooHaaaa
WoooHaaaa

Reputation: 20450

1. Download PCRE from PCRE.org

2. Compile it with a prefix and install it:

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

3. Go back to where your Apache installation is and compile Apache with PCRE:

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

Upvotes: 91

Related Questions