说明:本文记录两个CentOS 7安装Nginx时的错误;
场景&解决
CentOS 7安装Nginx,参考下面这篇文章:
- CentOS 7安装Nginx
进入nginx目录,运行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 nginx by using --with-pcre=<path> option.
提示系统缺少 PCRE库,使用下面的命令安装:
sudo yum install pcre pcre-devel
安装完成后,可使用下面的名称查看版本:
pcre-config --version
再运行configure文件,又报下面的错误:
错误信息:./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 by using --with-zlib=<path> option.
提示系统缺少zlib库,使用下面的命令安装:
sudo yum install zlib zlib-devel
再运行configure文件,终于可以了