安装报错:configure: error: openssl is a must but can not be found. You should add the directory containing `openssl.pc' to the `PKG_CONFIG_PATH' environment variable, or set `CFLAGS' and `LDFLAGS' directly for openssl, or use `--disable-openssl' to disable support for openssl encryption
解决办法:
下载openssl
1、查看路径
which openssl
2、查看版本
openssl version
3、查看CentOS版本
cat /etc/redhat-release
P.S. CentOS 7.6 默认版本:openssl-1.0.2k
下载办法:
方法一、直接安装
yum install openssl openssl-devel
方法二、下载源码编译安装
访问OpenSSL官网资源,查看是否有最新的版本发布。
官网资源地址:https://www.openssl.org/source
1、下载
wget https://www.openssl.org/source/old/1.1.1/openssl-1.1.1.tar.gz
2、解压并切换目录
tar -zxvf openssl-1.1.1.tar.gz
cd openssl-1.1.1
3、设定Openssl 安装,( --prefix )参数为欲安装之目录,也就是安装后的档案会出现在该目录下
./config --prefix=/usr/local/openssl
4、执行命令
./config -t
5、执行make、make install,编译Openssl
make & make install
P.S. 若CentOS7中没有GCC编译器,执行命令 yum -y install gcc 安装GCC。