Linux centos php7.4编译错误make: *** [sapi/cli/php] 错误 1,openssl-devel版本不符的原因
Linux centos php7.4编译错误make: *** 错误 1,openssl-devel版本不符的原因意思是系统安装了最新版的openssl 1.1.1k,但是openssl-devel版本为openssl-devel-1.0.1e-58.el6_10.x86_64,导致了问题
报错内容
/root/php-7.4.33/ext/openssl/xp_ssl.c:2425: undefined reference to `SSL_get0_alpn_selected'
ext/openssl/.libs/xp_ssl.o: In function `sk_GENERAL_NAME_num':
/usr/local/include/openssl/x509v3.h:166: undefined reference to `OPENSSL_sk_num'
ext/openssl/.libs/xp_ssl.o: In function `sk_GENERAL_NAME_value':
/usr/local/include/openssl/x509v3.h:166: undefined reference to `OPENSSL_sk_value'
ext/openssl/.libs/xp_ssl.o: In function `sk_GENERAL_NAME_pop_free':
/usr/local/include/openssl/x509v3.h:166: undefined reference to `OPENSSL_sk_pop_free'
/usr/local/include/openssl/x509v3.h:166: undefined reference to `OPENSSL_sk_pop_free'
/usr/local/include/openssl/x509v3.h:166: undefined reference to `OPENSSL_sk_pop_free'
ext/ftp/.libs/ftp.o: In function `ftp_login':
/root/php-7.4.33/ext/ftp/ftp.c:280: undefined reference to `TLS_client_method'
/root/php-7.4.33/ext/ftp/ftp.c:289: undefined reference to `SSL_CTX_set_options'
ext/phar/.libs/util.o: In function `phar_create_signature':
/root/php-7.4.33/ext/phar/util.c:1839: undefined reference to `EVP_MD_CTX_new'
/root/php-7.4.33/ext/phar/util.c:1875: undefined reference to `EVP_MD_CTX_free'
ext/phar/.libs/util.o: In function `phar_verify_signature':
/root/php-7.4.33/ext/phar/util.c:1559: undefined reference to `EVP_MD_CTX_new'
/root/php-7.4.33/ext/phar/util.c:1593: undefined reference to `EVP_MD_CTX_free'
/root/php-7.4.33/ext/phar/util.c:1583: undefined reference to `EVP_MD_CTX_free'
collect2: ld returned 1 exit status
make: *** 错误 1
php7.3及历史旧版本解决办法
yum -y remove openssl-devel
并且在php编译安装sh脚本中,删除相关的yum安装openssl-devel代码,然后重新开始解压php源码文件与重新编译
php7.4报错
configure: error: Package requirements (openssl >= 1.0.1) were not met:
No package 'openssl' found
php7.4版本除了卸载openssl-devel,还需要额外使用的解决办法,增加软链接
ln -s /usr/local/lib64/pkgconfig/libcrypto.pc /usr/lib64/pkgconfig/libcrypto.pc
ln -s /usr/local/lib64/pkgconfig/libssl.pc /usr/lib64/pkgconfig/libssl.pc
ln -s /usr/local/lib64/pkgconfig/openssl.pc /usr/lib64/pkgconfig/openssl.pc
如果在php7.4上启用libzip有类似的问题
https://bbs.itzmx.com/thread-111125-1-1.html
php8.1才要求升级openssl版本,8.0及以下一般使用系统默认版本就行,因为升级了会带来其他问题
https://bbs.itzmx.com/thread-111146-1-1.html
页:
[1]