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

After installing nginx in linux 64-bit, the following error is reported

1
2
3
[root @localhost nginx- 1.3 . 0 ]# /usr/local/nginx/sbin/nginx
error while loading shared libraries: libpcre.so. 1 :
cannot open shared object file: No such file or directory

It can be seen from the error that it is caused by the lack of lib files. Check further.

 

1
2
3
4
5
6
7
8
9
10
[root @localhost nginx- 1.3 . 0 ]# 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 )

It can be seen that libpcre.so.1 => not found is not found, enter the /lib64 directory to manually link

1
2
[root @localhost /]# cd lib64/
[root @localhost lib64]# ln -s libpcre.so. 0.0 . 1 libpcre.so. 1

Then start nginx and it's ok

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326977754&siteId=291194637