nginx无法启动: libpcre.so.1/libpcre.so.0: cannot open shared object file解决办法

作者: admin 分类: Error 发布时间: 2020-03-27 17:34

NGINX启动时提示错误:

[root@qunniao ~]# /usr/local/nginx/sbin/nginx -t
 /usr/local/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory

 

解决方法:

[root@qunniao ~]# ldd  /usr/local/nginx/sbin/nginx #如果是源码安装使用 ,rpm安装使用 ldd $(which  nginx)  
linux-vdso.so.1 (0x00007ffeb6b4f000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007ffb523a8000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ffb5218b000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007ffb51f50000)
libpcre.so.0 => not found
libssl.so.1.0.0 => /lib64/libssl.so.1.0.0 (0x00007ffb51ce2000)
libcrypto.so.1.0.0 => /lib64/libcrypto.so.1.0.0 (0x00007ffb5187a000)
libz.so.1 => /lib64/libz.so.1 (0x00007ffb51663000)
libc.so.6 => /lib64/libc.so.6 (0x00007ffb512be000)
/lib64/ld-linux-x86-64.so.2 (0x00007ffb525ac000)
[root@qunniao ~]# ln -s /usr/local/lib/libpcre.so.0 /lib64  #如果是32位为 /lib目录
[root@qunniao ~]# ldd  /usr/local/nginx/sbin/nginx
linux-vdso.so.1 (0x00007fff10568000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007faaf13b7000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007faaf119a000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007faaf0f5f000)
libpcre.so.0 => /lib64/libpcre.so.0 (0x00007faaf0d46000)
libssl.so.1.0.0 => /lib64/libssl.so.1.0.0 (0x00007faaf0ad8000)
libcrypto.so.1.0.0 => /lib64/libcrypto.so.1.0.0 (0x00007faaf0670000)
libz.so.1 => /lib64/libz.so.1 (0x00007faaf0459000)
libc.so.6 => /lib64/libc.so.6 (0x00007faaf00b4000)
/lib64/ld-linux-x86-64.so.2 (0x00007faaf15bb000)

 

注:
/usr/local/lib/libpcre.so.0 为prce安装后的文件地址


温馨提示:如无特殊说明,本站文章均为作者原创,转载请注明出处!

发表评论