PCRE Library is a library that is required to use HTTP rewrite when we do a compilation of nginx. The PCRE package contains Perl Compatible Regular Expression libraries useful for implementing regular expression pattern matching.
If PCRE is not installed on the server, it will result in the following error message during the Nginx compliation:
1 2 3 4 5 6 7 |
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: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, 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 so we can install Nginx Web Server with the HTTP rewrite module ? login into your server via SSH as user ‘root’
1) First, goto a temporary directory
1 |
# cd /usr/local/src |
2) Download PCRE:
1 |
# wget http://downloads.sourceforge.net/pcre/pcre-8.10.tar.bz2 |
3) Unpack and change to the pcre directory
1 2 |
# tar -jxf pcre-8.10.tar.bz2 # cd pcre-8.10 |
4) Confiure PCRE:
1 |
# ./configure |
5) Create the installation files and install PCRE
1 2 |
# make # make install |
Once done, you should be able to install Nginx with the HTTP rewrite module.