问题描述
报错信息如下所示:
./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.
原因
缺少pcre
和pcre-devel
解决
首先安装pcre
和pcre-devel
,rpm安装的时候注意依赖关系。
如果在安装以后还出现报错的情况,则使用命令指定pcre的源码路径进行安装。
./configure --prefix=/usr/local/nginx --with-pcre=/usr/local/pcre
-
--prefix
:选择nginx要安装的目录 -
--with-pcre
:选择pcre的源码所在目录