debian9.9编译php5.6.37报openssl错误

本文详细记录了在Debian9.9中,因OpenSSL1.1.1版本导致的PHP5.6编译错误的解决过程。通过降级OpenSSL至1.0.2版本并重新配置,最终成功解决了编译问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

编译参数:

./configure --prefix=/usr/local/php56 --with-config-file-path=/etc/php56 --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl

报错信息:

Makefile:623: recipe for target ‘ext/openssl/openssl.lo’ failed
make: *** [ext/openssl/openssl.lo] Error 1

查看openssl版本后,发现是比较新的1.1.1

root@LogCenter:~/php-5.6.38# openssl version
OpenSSL 1.1.1-pre2 (alpha) 27 Feb 2018

根据网上资料,发现debian9.9自带的这个openssl版本,php5.6不支持。

https://www.litespeedtech.com/support/forum/threads/debian-9-1-makefile-549-recipe-for-target-ext-openssl-openssl-lo-failed.15302/

所以手动安装1.0.2的openssl

https://www.openssl.org/source/openssl-1.0.2k.tar.gz
解压后进入文件夹
./config
make
make install
mv /usr/local/bin/openssl /usr/local/bin/openssl1.1.1
ln -s /usr/local/ssl/bin/openssl /usr/local/bin/openssl

再次尝试

make clean
重新configure,并指定openssl目录:
./configure --prefix=/usr/local/php56 --with-config-file-path=/etc/php56 --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl=/usr/local/ssl --enable-bcmath --enable-soap --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl

make没有报错,问题解决

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值