nginx 编译 问题
2015-10-29 10:11
831 查看
一、configure编译没有zlib library问题
在nginx中我们执行“./configure” 会提示
![](https://img-blog.csdn.net/20151029101253348?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
意思是告诉我们没有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执行以下命令:
然后再进行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
三、无法找到[b]libpcre.so.1问题[/b]
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)
[b]我们需要加一个链接[/b]
解决方法:
在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 |
二、缺少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
三、无法找到[b]libpcre.so.1问题[/b]
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)
[b]我们需要加一个链接[/b]
解决方法:
ln -s /usr/local/lib/libpcre.so.1 /lib64
相关文章推荐
- 从源码安装Mysql/Percona 5.5
- nginx代理指定目录
- 访问Nginx发生SSL connection error的一种情况
- Nginx+Naxsi部署专业级Web应用防火墙
- CentOS 6.2实战部署Nginx+MySQL+PHP
- 在 AppImage、Flathub 和 Snapcraft 平台上搜索 Linux 应用
- nginx中http核心模块的配置指令2
- nginx中http核心模块的配置指令3
- nginx中http核心模块的配置指令4
- nginx中http的fastcgi模块的配置指令1
- 解决vc中unable to connect to the MKS:Internal error问题
- Nginx 学习笔记(一)
- 网站502与504错误分析
- 杰奇一些安装详细说明文件,比官方更细
- 无线网卡安装DIY
- 网卡安装常见问题精解
- DB2数据库的安装
- CentOS下DB2数据库安装过程详解
- ghost安装系统软件硬盘安装器 安装ghost图文教程