首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我如何修正libssl.so.10( fix 64/libldap.so所需的) OpenSSL错误,在CentOS 7上编译CentOS时可能会与libssl.so.1.1发生冲突?

我如何修正libssl.so.10( fix 64/libldap.so所需的) OpenSSL错误,在CentOS 7上编译CentOS时可能会与libssl.so.1.1发生冲突?
EN

Stack Overflow用户
提问于 2019-03-15 14:59:06
回答 1查看 4.5K关注 0票数 2

我从一个完全干净的CentOS 7安装开始,没有安装任何东西。

一开始,yum install编辑了这些RPM:

  • 制作
  • 马特莱
  • pcre-devel
  • 外派发展
  • 埃佩尔释放
  • libxml2 2-发展
  • 百事
  • 惠特
  • 维姆
  • 林克斯
  • libnghttp2 2-发展
  • libnghttp2
  • nghttp2
  • 李平
  • gcc*
  • perl-模块-加载条件
  • perl-核
  • 卷曲
  • openssl-开发
  • mariadb-发展
  • unixODBC-发展
  • bzip2 2-发展
  • libjpeg发展
  • libXpm-发展
  • 自由型发展
  • gmp-发展
  • libmcrypt发展
  • httpd-devel

**决议编辑**添加以下RPMS:

  • 赛勒斯-萨塞尔
  • 赛勒斯

我已经从源代码编译了OpenSSL 1.1.1、cURL 7.62.0和HTTPD 2.4.38,分别使用以下命令:

OpenSSL

代码语言:javascript
复制
$ ./config \
  --prefix=/opt/openssl \
  -Wl,-rpath=/opt/openssl/bin \
  --openssldir=/opt/openssl \
  shared \
  zlib
$ make clean
$ make
$ make install
代码语言:javascript
复制
$ openssl version
OpenSSL 1.1.1  11 Sep 2018

cURL

代码语言:javascript
复制
$ env PKG_CONFIG_PATH=/opt/openssl/lib/pkgconfig ./configure \
  --prefix=/opt/curl \
  --with-ssl \
  LDFLAGS="-L/opt/openssl/lib -Wl,-rpath,/opt/openssl/lib"
  CPPFLAGS="-I/opt/openssl/include -Wl,-rpath,/opt/openssl/include"
make clean
make
make install
代码语言:javascript
复制
$ curl -V
curl 7.62.0 (x86_64-pc-linux-gnu) libcurl/7.62.0 OpenSSL/1.1.1 zlib/1.2.7 nghttp2/1.31.1
Release-Date: 2018-10-31
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy

HTTPD

代码语言:javascript
复制
$ env PKG_CONFIG_PATH=/opt/openssl/lib/pkgconfig ./configure \
  --prefix=/opt/httpd \
  --with-included-apr \
  --enable-so \
  --with-port=80 \
  --enable-http2 \
  --enable-ssl \
  --enable-ssl=shared \
  --with-ssl=/opt/openssl \
  --with-curl=/opt/curl \
  LDFLAG="-L/opt/openssl/lib -Wl,-rpath,/opt/openssl/lib -L/opt/curl/lib -Wl,-rpath,/opt/curl/lib" \
  CPPFLAGS="-I/opt/openssl/include -Wl,-rpath,/opt/openssl/include -I/opt/curl/include -Wl,-rpath,/opt/curl/include"
$ make clean
$ make
$ make install
代码语言:javascript
复制
$ httpd -v
Server version: Apache/2.4.38 (Unix)
Server built:   Mar 13 2019 15:14:01

到目前为止,一切都很顺利。我能够通过远程机器上的浏览器加载HTML页面。(开放港口80后)

这是我开始遇到问题的地方。

** OPENLDAP编辑(通过编译打开的LDAP解决) **

代码语言:javascript
复制
$ env PKG_CONFIG_PATH=/opt/openssl/lib/pkgconfig ./configure \
  --prefix=/opt/openldap \
  --with-tls \
  LDFLAGS="-L/opt/openssl/lib -Wl,-rpath,/opt/openssl/lib" \
  CPPFLAGS="-I/opt/openssl/include -Wl,-rpath,/opt/openssl/include"
$ make clean
$ make depend
$ make
$ make install

PHP

代码语言:javascript
复制
$ env PKG_CONFIG_PATH=/opt/openssl/lib/pkgconfig ./configure \
  --with-apxs2=/opt/httpd/bin/apxs \
  --prefix=/opt/php \
  --with-mysqli \
  --with-pdo-mysql \
  --enable-pdo \
  --enable-ftp \
  --with-zlib \
  --enable-zip \
  --enable-mbstring \
  --with-curl=/opt/curl \
  --with-openssl \
  --with-openssl-dir=/opt/openssl  \
  --enable-exif \
  --with-gd \
  --enable-shared \
  --enable-cgi \
  --with-ldap=/opt/openldap \
  LDFLAGS="-Wl,-rpath,/opt/openldap/lib -L/opt/openldap/lib -Wl,-rpath,/opt/openssl/lib -L/opt/openssl/lib" \
  CPPFLAGS="-Wl,-rpath,/opt/openldap/include -I/opt/openldap/include -Wl,-rpath,/opt/openssl/include -I/opt/openssl/include"
$ make clean
$ make
$ make install

犯错误

在运行make clean;make时,会出现以下错误:

代码语言:javascript
复制
  /usr/bin/ld: warning: libssl.so.10, needed by /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libldap.so, may conflict with libssl.so.1.1
  /usr/bin/ld: warning: libssl.so.10, needed by /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libldap.so, may conflict with libssl.so.1.1
  /usr/bin/ld: warning: libssl.so.10, needed by /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libldap.so, may conflict with libssl.so.1.1
  /usr/bin/ld: warning: libssl.so.10, needed by /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libldap.so, may conflict with libssl.so.1.1
  /usr/bin/ld: ext/openssl/.libs/xp_ssl.o: undefined reference to symbol 'SSLv3_server_method@@libssl.so.10'
  //usr/lib64/libssl.so.10: error adding symbols: DSO missing from command line
  collect2: error: ld returned 1 exit status
  make: *** [sapi/cli/php] Error 1

制作测试日志

make test命令返回相同的错误。

代码语言:javascript
复制
/usr/bin/ld: warning: libssl.so.10, needed by /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libldap.so, may conflict with libssl.so.1.1
/usr/bin/ld: warning: libssl.so.10, needed by /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libldap.so, may conflict with libssl.so.1.1
/usr/bin/ld: warning: libssl.so.10, needed by /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libldap.so, may conflict with libssl.so.1.1
/usr/bin/ld: warning: libssl.so.10, needed by /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libldap.so, may conflict with libssl.so.1.1
/usr/bin/ld: ext/openssl/.libs/xp_ssl.o: undefined reference to symbol 'SSLv3_server_method@@libssl.so.10'
//usr/lib64/libssl.so.10: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-03-15 15:05:29

若要停止此警告,请使用系统,不要自己编译。

或者您必须自己构建所有正在使用的针对OpenSSL的链接(在您的例子中是libldap)。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55185403

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档