./configure: error: the HTTP rewrite module requires the PCRE library - compiling nginx

Fix the "HTTP rewrite module requires PCRE library" error when compiling NGINX. Find out how to easily install the missing PCRE libraries and contin...

While compiling the NGINX web server, we may run into several errors, mainly resulting from missing developer libraries; here's one of them:

./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= option.

To eliminate the above error, we install the following package:

  • Debian/Ubuntu : aptitude install libpcre3-dev
  • RedHat/CentOS : yum install pcre-devel.x86_64 (64-bit architecture)