1. 程式人生 > >nginx編譯報錯處理

nginx編譯報錯處理

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

[root@localhost 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編譯報錯處理