Linux环境下,编译安装nginx报错

报错:

./configure: error: the HTTP XSLT module requires the libxml2/libxslt
libraries. You can either do not enable the module or install the libraries.

解决:
yum install libxml2-devel libxslt-devel

报错:

./configure: error: the HTTP image filter module requires the GD library.
You can either do not enable the module or install the libraries.

解决:
yum install gd-devel

报错:

./configure: error: perl module ExtUtils::Embed is required

解决:
yum -y install perl-ExtUtils-Embed

报错:

./configure: error: the Google perftools module requires the Google perftools
library. You can either do not enable the module or install the library.

解决:
yum -y install gperftools

make的时候报错:

出现 /usr/bin/ld: warning: libcrypto.so.1.1, needed by /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libssl.so, may conflict with libcrypto.so.10

系统中同时存在libcrypto.so.1.1和libcrypto.so.10两个版本的库,这可能导致冲突

解决:./configure后面接上openssl安装路径,--with-openssl=/usr/local/openssl

./configure  --prefix=/usr/share/nginx ...... --with-openssl=/usr/local/openssl

make的时候报错:

make[1]: *** [/usr/local/openssl/.openssl/include/openssl/ssl.h] 错误 127

解决:

vim /usr/local/nginx-1.24.0/auto/lib/openssl

注释掉这4行
            #CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
            #CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
            #CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
            #CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"

添加以下4行

            CORE_INCS="$CORE_INCS $OPENSSL/include"
            CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"
            CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"
            CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"

保存文件,执行 make clean 清除编译配置,再重新

./configure  --prefix=/usr/share/nginx ...... --with-openssl=/usr/local/openssl

make && make install

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值