nginx 编译 问题

一、configure编译没有zlib library问题
在nginx中我们执行“./configure” 会提示

意思是告诉我们没有zlib library的支持了 碰到此类问题我们只要安装这个库就可以。

下载后,解包,并进入nginx

开始nginx安装:
 
./configure
make
make install
 
若在“./configure”后方加入了“--with-http_gzip_static_module”(添加gzip压缩模块)提示以下错误:

./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using –without-http_gzip_module
option, or install the zlib library into the system, or build the zlib 
library
statically from the source with nginx by using –with-zlib=<path> option.

则需要安装“zlib-devel”即可。SSH执行以下命令:

 代码如下 复制代码

yum install -y zlib-devel

然后再进行nginx的编译。表示问题即可解决。

二、缺少C++编译器问题

像还有一些其它组件错误如:

You need a C++ compiler for C++ support

缺少c++编译器的原因


yum install -y gcc gcc-c++

make[1]: *** [/usr/local/pcre/Makefile] Error 127.pcre指向错误

指向源码包,不是编译安装后的包,所以

./configure –prefix=/export/lnmp/nginx-1.4.7 –with-pcre=../pcre-8.34

三、无法找到libpcre.so.1问题

nginx安装完成后,启动如果遇到如下问题:

./nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory

而这个时候如果你的pcre已经安装完成,则用如下方法解决:

可用  ldd /opt/nginx-1.8/sbin/nginx 查看链接

        linux-vdso.so.1 =>  (0x00007fff15bff000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00000036cf200000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00000036d1e00000)
        libpcre.so.1 => not found
        libz.so.1 => /lib64/libz.so.1 (0x00000036cea00000)
        libc.so.6 => /lib64/libc.so.6 (0x00000036cee00000)
        /lib64/ld-linux-x86-64.so.2 (0x00000036ce600000)
        libfreebl3.so => /lib64/libfreebl3.so (0x00000036d2600000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00000036cf600000)

如果是64位系统可去 /lib64/ 中查看libpcre.so.1是否存在

ll libpcre*
lrwxrwxrwx. 1 root root     16 Aug 14  2014 libpcre.so.0 -> libpcre.so.0.0.1
-rwxr-xr-x  1 root root 183816 Sep  7  2012 libpcre.so.0.0.1

可以发现只有libpcre.so.0 (低版本prce对应的libpcre.so.1 为libpcre.so.0

我们需要加一个链接

解决方法:

ln -s /usr/local/lib/libpcre.so.1 /lib64




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

clirus

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值