在RHEL 5.3上编译安装nginx后,启动时报错:
/usr/local/webserver/nginx/sbin/nginx
/usr/local/webserver/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory从错误看出是缺少lib库文件导致,进一步查看下
[root@domain ~]# ldd $(which /usr/local/nginx/sbin/nginx)
linux-gate.so.1 => (0x0071b000)
libpthread.so.0 => /lib/libpthread.so.0 (0×00498000) libcrypt.so.1 => /lib/libcrypt.so.1 (0×00986000) libpcre.so.1 => not found libcrypto.so.6 => /lib/libcrypto.so.6 (0×00196000) libz.so.1 => /lib/libz.so.1 (0×00610000) libc.so.6 => /lib/libc.so.6 (0x002d7000) /lib/ld-linux.so.2 (0x006a8000) libdl.so.2 => /lib/libdl.so.2 (0x008c3000)可以看出 libpcre.so.1 => not found 并没有找到,进入/lib目录中手动链接下
[root@localhost lib]# ln -s libpcre.so.0.0.1 libpcre.so.1 然后再启动nginx ok 了[root@domain ~]# /usr/local/nginx/sbin/nginx
[root@domain ~]# ps -ef |grep nginx root 14639 1 0 16:17 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx www 14640 14639 0 16:17 ? 00:00:00 nginx: worker process root 14642 14414 0 16:18 pts/1 00:00:00 grep nginx