nginx error while loading shared libraries: libpcre.so.1

 本文解决:nginx error while loading shared libraries: 
 
 Nginx启动报错:
 
error while loading shared libraries: libpcre.so.1:
cannot open shared object file: No such file or directory

从错误看出是缺少so文件(扩展库)导致。
 
验证猜想:使用 linux ldd 命令( ldd命令可以列出一个程序所需要得动态链接库(so))
 
ldd $(which /usr/local/nginx/sbin/nginx)

linux-vdso.so.1 => (0x00007fff4d5ff000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fea7e357000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fea7e120000)
libpcre.so.1 => not found
libz.so.1 => /lib64/libz.so.1 (0x00007fea7df09000)
libc.so.6 => /lib64/libc.so.6 (0x00007fea7db76000)
/lib64/ld-linux-x86-64.so.2 (0x00007fea7e57d000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007fea7d913000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fea7d70f000)

发现 libpcre.so.1 => not found (没有找到),find 搜索 libpcre.so.1 位置。发现在 /lib64 目录下。
 
执行:
 
ln -s /usr/local/lib/libpcre.so.1 /lib64

nginx -s reload #重启nginx

相关文章:
NGINX重启失败,nginx: [alert] kill(15004, 1) failed (3: No such process)
nginx: [error] invalid PID number “” in “/usr/local/var/run/nginx/nginx.pid”
Address already in use: make_sock: could not bind to address [::]:80
Nginx [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
解决nginx错误:413 Request Entity Too Large
 
 

0 个评论

要回复文章请先登录注册