CentOS 安装nginx 遇到的问题./configure: error: the HTTP gzip module requires the zlib library.You can eithe
1.遇到的问题:
./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=
2.这个问题是:在配置 Nginx 时遇到了 zlib 库缺失的问题。
Nginx 的 HTTP gzip 模块依赖于 zlib 库来进行压缩功能。为了解决这个问题,你可以选择安装 zlib 库及其开发文件,或者禁用 HTTP gzip 模块(不推荐),或者静态编译 zlib 库与 Nginx 一起。
我们使用最简单的方式直接安装这个库:
3.只需要按照下面的命令执行一遍即可。
# 安装必要的依赖项,包括 zlib 和 zlib-devel
sudo yum install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
# 验证 zlib-devel 是否安