报错代码1如下:
[root@xiaoming nginx-1.17.7]# ./configure --prefix=/soft/nginx-1.17.7 checking for OS + Linux 3.10.0-1062.el7.x86_64 x86_64 checking for C compiler ... not found ./configure: error: C compiler cc is not found
解决方法:
源码包的编译用到了linux系统里的编译器,通常源码包都是用C语言开发的,这里提示缺少c语言编译器,只需要使用yum仓库安装gcc这个包即可
yum install -y gcc
报错代码2如下:
./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库文件
yum install -y pcre-devel
报错代码3:
./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.
解决方法:
同代码2一样,同样缺少zlib库文件,我们只要安装zlib-devel即可
yum install -y zlib-devel