PCRE Library Not Found: Nginx compilation

The HTTP rewrite module requires the PCRE library during the Nginx compilation. The PCRE package contains Perl Compatible Regular Expression libraries useful for implementing regular expression pattern matching.

If PCRE package is not installed on the server, NGINX installation will fail with the following message:

checking for PCRE library ... not found 
checking for PCRE library in /usr/local/ ... not found 
checking for PCRE library in /usr/include/pcre/ ... not found 


./configure: the HTTP rewrite module requires the PCRE library. 
You can disable the module by using --without-http_rewrite_module 
or install the PCRE library into the system, 
or build the PCRE library statically from the source with nginx 
by using--with-pcre=<path> option.

How to Install the PCRE library?

1) SSH to the server and go to a temporary directory

 # cd /usr/local/src

2) Download PCRE:

 # wget http://downloads.sourceforge.net/pcre/pcre-8.10.tar.bz2

3) Unpack and change to the pcre directory

# tar -jxf pcre-8.10.tar.bz2 
# cd pcre-8.10

4) Confiure PCRE:

# ./configure

5) Create the installation files and install PCRE

# make 
# make install

Once done, you should be able to install Nginx with the HTTP rewrite module.

This entry was posted on Saturday, January 22nd, 2011 and is filed under Linux Administration. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.