启动nginx,报错:error while loading shared libraries: libpcre.so.1:
2014-06-29 20:53
513 查看
$./nginx 或者 /usr/local/nginx/sbin/nginx 来启动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
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
Start nginx now, you should be able to start.
OK,nginx 已经启动了。
---注:不过,我需要先切到root下,再去执行
转:http://chandank.com/webservers/nginx/nginx-error-while-loading-shared-libraries-libpcre-so-1
./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.
[root@localhost lib]# /usr/local/nginx/sbin/nginx
[root@localhost lib]# ps -ef |grep nginxroot 9539 1 0 19:06 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginxwww 9540 9539 0 19:06 ? 00:00:00 nginx: worker process
OK,nginx 已经启动了。
---注:不过,我需要先切到root下,再去执行
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH 和/usr/local/nginx/sbin/nginx 才行。否则,会没有权限。
转:http://chandank.com/webservers/nginx/nginx-error-while-loading-shared-libraries-libpcre-so-1
相关文章推荐
- 启动nginx 报错 error while loading shared libraries: libpcre.so.1: cannot open shared object file
- 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: cannot open shared object file
- Nginx启动错误:error while loading shared libraries: libpcre.so.1
- nginx启动报错 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
- Tengine/Nginx 启动出错 error while loading shared libraries: libpcre.so.1
- Nginx启动错误:error while loading shared libraries: libpcre.so.1
- Nginx启动出错 error while loading shared libraries
- 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: libssl.so.6
- Nginx启动时error while loading shared libraries: libcrypto.so.1.1
- ./nginx: error while loading shared libraries: libpcre.so.1
- Nginx: error while loading shared libraries: libpcre.so.1解决
- /opt/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object
- Nginx启动出错 error while loading shared libraries