linux: 安装openssl

一,下载和安装

说明:编译安装openssl的原因是:

编译安装 PHP 7.4.33 报错:

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

openssl下载

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

解压

tar -zxvf openssl-1.1.1w.tar.gz

配置

cd openssl-1.1.1w/
./config --prefix=/opt/openssl --shared 

编译和安装:

# make && make install

二,报错的处理:

报错信息:

./config --prefix=/opt/openssl --shared
Operating system: x86_64-whatever-linux2
Can't locate FindBin.pm in @INC (you may need to install the FindBin module) (@INC contains: /usr/local/lib64/perl5/5.32 /usr/local/share/perl5/5.32 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ./Configure line 15.
BEGIN failed--compilation aborted at ./Configure line 15.
Can't locate FindBin.pm in @INC (you may need to install the FindBin module) (@INC contains: /usr/local/lib64/perl5/5.32 /usr/local/share/perl5/5.32 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ./Configure line 15.
BEGIN failed--compilation aborted at ./Configure line 15.
This system (linux-x86_64) is not supported. See file INSTALL for details. 

解决:

# yum install perl-FindBin

 三,报错的处理之二

报错信息:

sh: line 1: pod2html: command not found 

解决:

# yum install -y perl

四,报错的处理之三

# ./bin/openssl help
./bin/openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

解决:

# ln -s /opt/openssl/lib/libssl.so.1.1 /lib64/libssl.so.1.1
# ln -s /opt/openssl/lib/libcrypto.so.1.1 /lib64/libcrypto.so.1.1 

测试效果:

# ./bin/openssl help
Standard commands
asn1parse         ca                ciphers           cms
crl               crl2pkcs7         dgst              dhparam
dsa               dsaparam          ec                ecparam 

 

posted @ 2026-01-10 10:20  刘宏缔的架构森林  阅读(33)  评论(0)    收藏  举报