【程序运行时找不到库文件】nginx: error while loading shared libraries: libpcre.so.1
来源:互联网 发布:雷蒙德钱德勒 知乎 编辑:程序博客网 时间:2024/05/16 12:04
【程序运行时候找不到库文件】
【解决办法:1.找下你需要的库是否存在:查找下usr/local/lib
2.如果存在这个库的话,通过设置LD_LIBRARY_PATH=/usr/local/lib: 这个环境变量,把库的路径加进去
3.重新编译程序运行看看。
原理:
系统对动态库查找规则:
/lib
/usr/lib
到环境变量LD_LIBRARY_PATH指定的路径中查找/etc/profile 下面有显示路径 环境变量,每个目录用 : 分割 window目录分割用 ;
【1.在文件/etc/profile改 2.export LD_LIBRARY_PATH=:.:~(当前用户主目录):..:~soft01(soft01用户的主目录)】
】
$./nginx
./nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
$
If you are getting above error while starting nginx, you can fix by following.
This generally happens due to following three reasons.
- You don’t have PCRE installed
- Nginx was not complied & installed using pcre
- PCRE library is not set in LD_LIBRARY_PATH
There are multiple ways to fix this issue. The best way I believe is using troubleshooting skills. Let’s understand the error and fix it accordingly.
nginx: error while loading shared libraries: libpcre.so.1
nginx is looking for file libpcre.so.1 which comes under PCRE library and usually installed on UNIX.
- Let’s find libpcre.so.1 using find command
$find / -name libpcre.so.1/usr/local/lib/libpcre.so.1$
Ok, so I do have this file which means PCRE is already installed and will proceed with next troubleshooting step.
Note: If you don’t get find results then you got to install PCRE. You can either install using yum install pcre on Linux/CentOS or can ask system administrator to install it.
- Now, let’s set LD_LIBRARY_PATH as we could see libpcre.so.1 is available under /usr/local/lib
$export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
- Start nginx now, you should be able to start.
- 【程序运行时找不到库文件】nginx: error while loading shared libraries: libpcre.so.1
- Nginx: error while loading shared libraries: libpcre.so.1
- ./nginx: error while loading shared libraries: libpcre.so.1
- Nginx: error while loading shared libraries: libpcre.so.1
- Nginx: error while loading shared libraries: libpcre.so.1解决
- Nginx: error while loading shared libraries: libpcre.so.1解决
- nginx 启动时出现 error while loading shared libraries: libpcre.so.1的错误
- nginx: error while loading shared libraries libpcre.so
- /opt/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object
- [error]error while loading shared libraries: libpcre.so.1 解决
- nginx运行时报错:error while loading shared libraries: libpcre.so.3
- error while loading shared libraries: libpcre.so.1
- error while loading shared libraries: libpcre.so.1错误
- 【curl】error while loading shared libraries: libpcre.so.1
- nginx启动报错 nginx: error while loading shared libraries: libpcre.so.1
- /usr/local/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1
- Nginx启动出错 error while loading shared libraries: libpcre.so.1
- 启动nginx,报错:error while loading shared libraries: libpcre.so.1:
- Android 动画效果 --Animation 动画(讲解了所有的Android动画效果,是一个值得收藏的帖子)
- Retrieving the COM class factory for component with CLSID {C1F400A0-3F08-11D3-9F0B-006008039E37} fai
- 一个应用实例详解卡尔曼滤波及其算法实现
- 异常处理的基本过程
- 关于block 中 何时使用 __weak/__block MyViewController * weakSelf 分析
- 【程序运行时找不到库文件】nginx: error while loading shared libraries: libpcre.so.1
- linux内核中的xx_initcall和module_init实现机制(linux3.1.0)
- 系统学习hbase
- CUDA学习(3)——运行黑屏后恢复
- mint 下fictx输入法
- nmon 介绍和使用
- Android动画之translate(位移动画)
- Jasper Reports Development's Shoulds and Shouldn'ts
- 模拟器运行出错-- Unable to run app in simulator:An error was encountered while running