Nginx: error while loading shared libraries: libpcre.so.1 不指定

Heck post in 学习心得 2017/06/21 14:09 评论(0) 阅读(226) | |
[ubuntu@titan]# /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

[ubuntu@titan]# sbin/nginx
sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory

[ubuntu@titan]# error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory

[ubuntu@titan]# whereis libpcre.so.1
libpcre.so: /lib64/libpcre.so.0 /usr/local/lib/libpcre.so /usr/local/lib/libpcre.so.1

添加软链接:
[ubuntu@titan]# 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文件.
所以在改用下面的软连接:

[ubuntu@titan]# ln -s /usr/local/lib/libpcre.so.1 /lib64

来源:Heck's Blog
地址:http://www.hecks.tk/post/458/
转载时须以链接形式注明作者和原始出处及本声明,否则将追究法律责任,谢谢配合!