排第四偶家 发表于 2016-12-26 08:50:55

Nginx: error while loading shared libraries: libpcre.so.1解决

Nginx: error while loading shared libraries: libpcre.so.1解决
 
Shell代码  
# /usr/local/nginx/sbin/nginx  
/usr/local/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory  
 
确认已经安装PCRE: 
Shell代码  
$ cd /lib  
$ ls *pcre*  
libpcre.so.0  libpcre.so.0.0.1  
$ find / -type f -name *libpcre.so.*   
添加软链接:
Shell代码  
$ ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1  
前面在一般的linux上可以解决此问题.
 
注: 在有的操作系统上面,安装pcre后,安装的位置为/usr/local/lib/*pcre*
在redhat 64位机器之上有这样的情况.
在redhat 64位机器上, nginx可能读取的pcre文件为/lib64/libpcre.so.1文件.
所以在改用下面的软连接:
Shell代码  
$ ln -s /usr/local/lib/libpcre.so.1 /lib64/  
页: [1]
查看完整版本: Nginx: error while loading shared libraries: libpcre.so.1解决