设为首页收藏本站

ZMX - IT技术交流论坛 - 无限Perfect,追求梦想 - itzmx.com

 找回密码
 注册论坛

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

用百度帐号登录

只需两步,快速登录

搜索
查看: 241|回复: 0

Linux centos php7.4编译错误make: *** [sapi/cli/php] 错误 1,openssl-devel版本不符的原因

[复制链接]
 成长值: 387

签到天数: 4754 天

[LV.Master]伴坛终老

发表于 2024/12/24 01:30 | 显示全部楼层 |阅读模式 |Google Chrome 131.0.0.0|Windows 10
天涯海角搜一下: 百度 谷歌 360 搜狗 有道 雅虎 必应 即刻
Linux centos php7.4编译错误make: *** [sapi/cli/php] 错误 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: *** [sapi/cli/php] 错误 1


php7.3及历史旧版本解决办法
  1. 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,还需要额外使用的解决办法,增加软链接
  1. ln -s /usr/local/lib64/pkgconfig/libcrypto.pc /usr/lib64/pkgconfig/libcrypto.pc
  2. ln -s /usr/local/lib64/pkgconfig/libssl.pc /usr/lib64/pkgconfig/libssl.pc
  3. 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
欢迎光临IT技术交流论坛:http://bbs.itzmx.com/
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册论坛 新浪微博账号登陆用百度帐号登录

本版积分规则

手机版|Archiver|Mail me|网站地图|IT技术交流论坛 ( 闽ICP备13013206号-7 )

GMT+8, 2025/1/9 01:13 , Processed in 0.224248 second(s), 20 queries , MemCache On.

Powered by itzmx! X3.4

© 2011- sakura

快速回复 返回顶部 返回列表