/opt/nginx/sbin/nginx: error while loading shared librari

Cookie_1030發表於2017-11-08

問題:

#nginx啟動報錯

[root@localhost ~]# /opt/nginx/sbin/nginx 

/opt/nginx/sbin/nginx: error while loading shared libraries: libGeoIP.so.1: cannot open shared object file: No such file or directory



[root@localhost ~]# cd /opt/

[root@localhost opt]# wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz


[root@localhost opt]# tar zxvf GeoIP.tar.gz

[root@localhost opt]# cd GeoIP-1.4.8/

[root@localhost GeoIP-1.4.8]# ./configure

[root@localhost GeoIP-1.4.8]# make && make install


[root@localhost GeoIP-1.4.8]# /opt/nginx/sbin/nginx -t
/opt/nginx/sbin/nginx: error while loading shared libraries: libGeoIP.so.1: cannot open shared object file: No such file or directory


[root@localhost GeoIP-1.4.8]# locate libGeoIP.so.1
/usr/local/lib/libGeoIP.so.1
/usr/local/lib/libGeoIP.so.1.4.8


[root@localhost GeoIP-1.4.8]# echo "/usr/local/lib" >> /etc/ld.so.conf

[root@localhost GeoIP-1.4.8]# ldconfig


[root@localhost GeoIP-1.4.8]# /opt/nginx/sbin/nginx -t
nginx: the configuration file /opt/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /opt/nginx/conf/nginx.conf test is successful


相關文章