在./configure的过程中会出现以下的报错
./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
./configure: error: the HTTP gzip module requires the zlib library. You can either disable the module by using --without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with nginx
这个错误是由于您正在尝试编译nginx并启用HTTP重写模块,但系统缺少PCRE库。有几种解决方案可以解决这个问题:
安装系统上的PCRE库。在Ubuntu / Debian上,您可以使用以下命令:
sudo apt-get install libpcre3 libpcre3-dev
在CentOS / RedHat上,您可以使用以下命令安装PCRE:
sudo yum install pcre pcre-devel
第二个则需要安装zlib-devel
即可。SSH执行以下命令:
代码如下 复制代码
yum install -y zlib-devel