Nginx启动错误:error while loading shared libraries: libpcreso1
程序员文章站
2024-04-05 10:31:12
...
1 |
#
/usr/local/nginx/sbin/nginx |
2 |
/usr/ local /nginx/sbin/nginx:
error while loading
shared libraries: libpcre.so.1: cannot open shared
object file :
No such file or
directory
|
从错误提示信息可以得知是因为缺少lib文件导致,进一步查看具体内容:
1 |
#
ldd $(which /usr/local/nginx/sbin/nginx) |
2 |
libpthread.so.0
=> /lib64/libpthread.so.0 (0x00000030e8400000)
|
3 |
libcrypt.so.1
=> /lib64/libcrypt.so.1 (0x00000030f9a00000)
|
4 |
libpcre.so.1
=> not found
|
5 |
libcrypto.so.6
=> /lib64/libcrypto.so.6 (0x00000030f2a00000)
|
6 |
libz.so.1
=> /lib64/libz.so.1 (0x00000030e8800000)
|
7 |
libc.so.6
=> /lib64/libc.so.6 (0x00000030e7800000)
|
8 |
/lib64/ld-linux-x86-64.so.2
(0x00000030e7400000)
|
9 |
libdl.so.2
=> /lib64/libdl.so.2 (0x00000030e8000000)
|
查看结果显示 : libpcre.so.1 => not found ,同时注意lib库的路径,有/lib/* 和 /lib64/* 之分。
比如上面的是 /lib64/*,这个和下面解决问题时创建的软连接有关系
解决办法:
1、首先确认已经安装好pcre 软件(nginx 依赖该软件)
2、创建软连接
对于/lib/* 32位系统来说:
1 |
#查看lib库 |
2 |
#
ls /lib/ |grep pcre |
3 |
libpcre.so.0 |
4 |
libpcre.so.0.0.1 |
5 |
#添加软连接 |
6 |
#
ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1 |
ps: 也有可能 pcre lib文件在目录:/usr/local/lib/
对于/lib64/* 64位系统来说:
1 |
#查看lib库 |
2 |
#
ls /lib64/ |grep pcre |
3 |
libpcre.so. 0
|
4 |
libpcre.so. 0.0 . 1
|
5 |
#添加软连接 |
6 |
#
ln -s /lib64/libpcre.so. 0.0 . 1 /lib64/libpcre.so. 1
|
ps: 也有可能 pcre lib文件在目录:/usr/local/lib64/。
以上就介绍了Nginx启动错误:error while loading shared libraries: libpcreso1,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
推荐阅读
-
Nginx启动错误:error while loading shared libraries: libpcreso1
-
【linux】error while loading shared libraries no such file or directory错误解决方法
-
Nginx: error while loading shared libraries: libpcre.so.1 博客分类: Apache/Nginx nginxlibpcre.so.1pcreln
-
error while loading shared libraries: libnsl.so.2: cannot open shared object file: No such
-
error while loading shared libraries: libcudart.so.9.0: cannot open shared object file: No such file
-
Linux error while loading shared libraries: cannot open shared object file: No such file or director
-
error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such
-
error while loading shared libraries: librediscluster.so..: cannot open shared object file: No such
-
error while loading shared libraries: libfslio.so: cannot open shared object file: No such file
-
error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such