一聚教程网:一个值得你收藏的教程网站

热门教程

Nginx编译安装错误error: the HTTP gzip module requires the zlib library

时间:2022-06-30 18:41:25 编辑:袖梨 来源:一聚教程网

下载后,解包,并进入nginx

 
tar -zxf nginx-1.4.7.tar.gz
cd nginx-1.4.7
 
开始nginx安装:
 
./configure
make
make install
 
若在“./configure”后方加入了“--with-http_gzip_static_module”(添加gzip压缩模块)提示以下错误:

./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= option.

则需要安装“zlib-devel”即可。SSH执行以下命令:

 代码如下 复制代码

yum install -y zlib-devel

然后再进行nginx的编译。表示问题即可解决。

像还有一些其它组件错误如:

You need a C++ compiler for C++ support

缺少c++编译器的原因


yum install -y gcc gcc-c++

make[1]: *** [/usr/local/pcre/Makefile] Error 127.pcre指向错误

指向源码包,不是编译安装后的包,所以

./configure –prefix=/export/lnmp/nginx-1.4.7 –with-pcre=../pcre-8.34

好了我在使用nginx编译安装时碰到几大问题都总结了一下,希望能帮助到各位。

热门栏目