nginx编译报错处理

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx编译报错处理相关的知识,希望对你有一定的参考价值。

下载nginx安装包
wget http://nginx.org/download/nginx-1.9.15.tar.gz && tar xvf nginx-1.9.15.tar.gz && cd nginx-1.9.15

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

首先想到的是yum -y install zlib

不知道咋回事儿没装上去 (我用的是eprl的网络源)在这里不纠结为啥yum不能安装的问题

立马祭出一条命令:find / -name zlib

[[email protected] nginx-1.9.15]# find / -name zlib
/etc/yum.repos.d/nginx-1.9.15/auto/lib/zlib

nginx源码包自带zlib

接下来在编译的时候:./configure --prefix==/usr/local/nginx --with-zlib=/etc/yum.repos.d/nginx-1.9.15/auto/lib/zlib

报错信息中发现不再是缺少zlib包,缺少其他包也可以按照这种操作进行直到最后输出结果为

nginx path prefix: "/usr/local/product/nginx1.9.14"
  nginx binary file: "/usr/local/product/nginx1.9.14/sbin/nginx"
  nginx modules path: "/usr/local/product/nginx1.9.14/modules"
  nginx configuration prefix: "/usr/local/product/nginx1.9.14/conf"
  nginx configuration file: "/usr/local/product/nginx1.9.14/conf/nginx.conf"
  nginx pid file: "/usr/local/product/nginx1.9.14/logs/nginx.pid"
  nginx error log file: "/usr/local/product/nginx1.9.14/logs/error.log"
  nginx http access log file: "/usr/local/product/nginx1.9.14/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

输出以上信息表示nginx编译成功


以上是关于nginx编译报错处理的主要内容,如果未能解决你的问题,请参考以下文章

nginx: [emerg] unknown directive “ ” in /usr/local/nginx/nginx.conf.conf:xx报错处理

nginx中 处理post方式打开页面的报错405

centos7 安装nginx及处理报错信息

centos7 安装nginx及处理报错信息

JACK报错处理&多用户编译

三个思路解决413 Request Entity Too Large报错处理