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

在nginx中我们执行./configure 会提示error: the HTTP gzip module requires the zlib library意思是告诉我们没有zlib library的支持了 碰到此类问题我们只要安装这个库就可以了。

下载后,解包,并进入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=<path> 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
全部评论

相关推荐

03-26 13:44
南华大学 Java
在看面经的花生米很野蛮:这种情况下你当然要回答,你也是吗!!!!我超喜欢他的XXXXX
点赞 评论 收藏
分享
SadnessAlex:跟三十五岁原则一样,人太多给这些***惯坏了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务