php安装:make时报错:make: *** [Makefile:747: ext/openssl/openssl.lo] Error 1

一,报错信息:

make: *** [Makefile:747: ext/openssl/openssl.lo] Error 1

二,问题原因

查看当前服务器上的openssl库的版本:

# rpm -qa | grep openssl
openssl-libs-3.2.2-6.el9.x86_64
apr-util-openssl-1.6.1-23.el9.x86_64
openssl-3.2.2-6.el9.x86_64
openssl-devel-3.2.2-6.el9.x86_64

我们安装的是php 7.4,
当前的openssl版本太高,所以需要我们手动下载一个低版本的openssl库供编译时使用

三,解决

1,下载

官网地址:

https://openssl-library.org/source/old/1.1.1/

用命令下载到本地:

# wget https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz

2,安装:

解压

# tar -zxvf openssl-1.1.1w.tar.gz

配置:

# cd openssl-1.1.1w/
# ./config --prefix=/opt/openssl-1.1.1w --shared
Operating system: x86_64-whatever-linux2
Configuring OpenSSL version 1.1.1w (0x1010117fL) for linux-x86_64
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL file first)         ***
***                                                                ***
**********************************************************************

编译并安装

# make && make install

3,重新安装php

注意指定openssl的路径

--with-openssl-dir=/opt/openssl-1.1.1w

 

posted @ 2025-09-27 17:06  刘宏缔的架构森林  阅读(93)  评论(0)    收藏  举报