安装nginx出错the HTTP rewrite module requires the PCRE library

问题描述

报错信息如下所示:

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

原因

缺少pcrepcre-devel

解决

首先安装pcrepcre-devel,rpm安装的时候注意依赖关系。

如果在安装以后还出现报错的情况,则使用命令指定pcre的源码路径进行安装。

 ./configure --prefix=/usr/local/nginx --with-pcre=/usr/local/pcre
  • --prefix:选择nginx要安装的目录
  • --with-pcre:选择pcre的源码所在目录

相关文章