在 RHEL7.8 上编译 php 时,我收到以下警告消息。我可以成功编译和安装 php,但我不确定这些警告会产生什么副作用。有什么方法可以解决这些警告吗?
/usr/bin/ld: warning: libssl.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libssl.so.1.1
/usr/bin/ld: warning: libssl.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libssl.so.1.1
/usr/bin/ld: warning: libcrypto.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libcrypto.so.1.1
/usr/bin/ld: warning: libcrypto.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libcrypto.so.1.1
/usr/bin/ld: warning: libcrypto.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libcrypto.so.1.1
/usr/bin/ld: warning: libcrypto.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libcrypto.so.1.1
/usr/bin/ld: warning: libssl.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libssl.so.1.1
/usr/bin/ld: warning: libssl.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libssl.so.1.1
/usr/bin/ld: warning: libcrypto.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libcrypto.so.1.1
/usr/bin/ld: warning: libcrypto.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libcrypto.so.1.1
/usr/bin/ld: warning: libcrypto.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libcrypto.so.1.1
/usr/bin/ld: warning: libcrypto.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libcrypto.so.1.1
/usr/bin/ld: warning: libssl.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libssl.so.1.1
/usr/bin/ld: warning: libssl.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libssl.so.1.1
/usr/bin/ld: warning: libcrypto.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libcrypto.so.1.1
/usr/bin/ld: warning: libcrypto.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libcrypto.so.1.1
/usr/bin/ld: warning: libcrypto.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libcrypto.so.1.1
/usr/bin/ld: warning: libcrypto.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libcrypto.so.1.1
#OpenSSL Installation
./config --prefix=/usr/local/ssl shared
make
make test
make install
#Apache Installation
./configure \
--prefix=/usr/local/apache2 \
--with-ssl=/usr/local/ssl \
--with-included-apr \
--with-mpm=prefork \
--enable-ssl \
--enable-modules=all \
--enable-mods-shared=most \
make
make install
#PHP Installation
'./configure' \
'--prefix=/usr/local/php7' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--with-config-file-path=/usr/local/php7/conf' \
'--with-curl' \
'--with-kerberos' \
'--with-openssl=/usr/local/ssl' \
'--with-openssl-dir=/usr/local/ssl' \
'--with-zlib' \
'--with-zlib-dir=/lib64/' \
'--enable-bcmath' \
'--enable-ftp' \
'--enable-gd-native-ttf' \
'--enable-mbstring' \
'--enable-opcache' \
'--enable-pcntl' \
'--enable-pdo' \
'--enable-shared' \
'--enable-shmop' \
'--enable-soap' \
'--enable-sockets' \
'--enable-sysvshm' \
'--enable-xml' \
'--enable-zip' \
'--without-libzip' \
ldd /usr/local/ssl/bin/openssl
linux-vdso.so.1 => (0x00007fff46493000)
libssl.so.1.1 => /usr/local/ssl/lib/libssl.so.1.1 (0x00007fc710c31000)
libcrypto.so.1.1 => /usr/local/ssl/lib/libcrypto.so.1.1 (0x00007fc710746000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fc710542000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc710326000)
libc.so.6 => /lib64/libc.so.6 (0x00007fc70ff58000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc710ec3000)
ldd /usr/local/apache2/bin/httpd
linux-vdso.so.1 => (0x00007ffcea29e000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fcb03f33000)
libaprutil-1.so.0 => /usr/local/apache2/lib/libaprutil-1.so.0 (0x00007fcb03d09000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x00007fcb03adf000)
libapr-1.so.0 => /usr/local/apache2/lib/libapr-1.so.0 (0x00007fcb038a4000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x00007fcb0369f000)
librt.so.1 => /lib64/librt.so.1 (0x00007fcb03497000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fcb03260000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fcb03044000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fcb02e40000)
libc.so.6 => /lib64/libc.so.6 (0x00007fcb02a72000)
/lib64/ld-linux-x86-64.so.2 (0x00007fcb04195000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007fcb0286f000)
ldd /usr/local/apache2/modules/mod_ssl.so
linux-vdso.so.1 => (0x00007ffc2019d000)
libssl.so.1.1 => /usr/local/ssl/lib/libssl.so.1.1 (0x00007fb63e115000)
libcrypto.so.1.1 => /usr/local/ssl/lib/libcrypto.so.1.1 (0x00007fb63dc2a000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x00007fb63da25000)
librt.so.1 => /lib64/librt.so.1 (0x00007fb63d81d000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fb63d5e6000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fb63d3ca000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fb63d1c6000)
libc.so.6 => /lib64/libc.so.6 (0x00007fb63cdf8000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb63e5e4000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007fb63cbf5000)
# ldd /usr/local/php7/bin/php
/lib64/ld-linux-x86-64.so.2 (0x00007ffadb8d3000)
libbz2.so.1 => /lib64/libbz2.so.1 (0x00007ffad4ed8000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007ffad7d23000)
libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007ffad45dc000)
libcrypto.so.1.1 => /usr/local/ssl/lib/libcrypto.so.1.1 (0x00007ffad91a8000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007ffadb69c000)
libc.so.6 => /lib64/libc.so.6 (0x00007ffad742c000)
libcurl.so.4 => /lib64/libcurl.so.4 (0x00007ffad7ab9000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007ffada34d000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007ffad7229000)
libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00007ffad77fa000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007ffad8443000)
libidn.so.11 => /lib64/libidn.so.11 (0x00007ffad67a0000)
libifasf.so => /home/informix/lib/libifasf.so (0x00007ffadac28000)
libifcli.so => /home/informix/lib/cli/libifcli.so (0x00007ffadb2e3000)
libifdmr.so => /home/informix/lib/cli/libifdmr.so (0x00007ffadb0db000)
libifgen.so => /home/informix/lib/esql/libifgen.so (0x00007ffada9c6000)
libifgls.so => /home/informix/lib/esql/libifgls.so (0x00007ffada551000)
libifglx.so => /home/informix/lib/esql/libifglx.so (0x00007ffada14b000)
libifos.so => /home/informix/lib/esql/libifos.so (0x00007ffada7a4000)
libifsql.so => /home/informix/lib/esql/libifsql.so (0x00007ffadae87000)
libjpeg.so.62 => /lib64/libjpeg.so.62 (0x00007ffad9693000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007ffad7f27000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007ffad69d3000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007ffad815a000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007ffad6bd7000)
liblber-2.4.so.2 => /lib64/liblber-2.4.so.2 (0x00007ffad533d000)
libldap-2.4.so.2 => /lib64/libldap-2.4.so.2 (0x00007ffad50e8000)
liblzma.so.5 => /lib64/liblzma.so.5 (0x00007ffad6de7000)
libm.so.6 => /lib64/libm.so.6 (0x00007ffad8c14000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x00007ffad89fa000)
libnspr4.so => /lib64/libnspr4.so (0x00007ffad554c000)
libnss3.so => /lib64/libnss3.so (0x00007ffad5dc3000)
libnssutil3.so => /lib64/libnssutil3.so (0x00007ffad5b93000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007ffad415d000)
libplc4.so => /lib64/libplc4.so (0x00007ffad578a000)
libplds4.so => /lib64/libplds4.so (0x00007ffad598f000)
libpng15.so.15 => /lib64/libpng15.so.15 (0x00007ffad98e8000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ffad700d000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007ffad9d1b000)
librt.so.1 => /lib64/librt.so.1 (0x00007ffad9b13000)
libsasl2.so.3 => /lib64/libsasl2.so.3 (0x00007ffad43bf000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007ffad4cb1000)
libsmime3.so => /lib64/libsmime3.so (0x00007ffad60f2000)
libssh2.so.1 => /lib64/libssh2.so.1 (0x00007ffad6573000)
libssl3.so => /lib64/libssl3.so (0x00007ffad631a000)
libssl.so.10 => /lib64/libssl.so.10 (0x00007ffad4a3f000)
libssl.so.1.1 => /usr/local/ssl/lib/libssl.so.1.1 (0x00007ffad8f16000)
libxml2.so.2 => /lib64/libxml2.so.2 (0x00007ffad8690000)
libz.so.1 => /lib64/libz.so.1 (0x00007ffad9f35000)
linux-vdso.so.1 => (0x00007fffe9bb3000)
答案1
您收到这些警告是因为您尝试将 PHP 链接到 OpenSSL 1.1.x ( *.so.1.1
),而 libssh2 链接到 OpenSSL 1.0.x ( *.so.10
)。
真正解决这个问题的唯一方法是将 PHP 和 libssh2 链接到同一版本的 OpenSSL(或者您可以尝试弄清楚是否需要引入 libssh2 的组件并避免构建这个 PHP 扩展 - 但这可能是 cURL...因此这个建议可能根本不起作用)。
根据libssh2 的自述文件,您也可以选择自行重建 libssh2,要么完全不支持 OpenSSL,要么支持 libgcrypt。但在执行此操作之前,您应该仔细检查您是否在其他地方使用了 libssh2,以及这种更改会造成哪些影响。
实际上,这个 OpenSSL 链接混合物通常情况下仍然运行良好,即使它会抛出构建时警告……但并不能保证。如果在这种情况下出现问题,除了分段错误或加载 mod_php 或启动 php-fpm 时崩溃之外,我预计它们与加密有关。