Shopify Free Trial Apply
Shopify 60天试用
Shopify 14天试用

centos 系统 php Curl 无法访问https ,更换ssl_version NSS为openssl

cat /etc/redhat-release

CentOS Linux release 7.5.1804 (Core)

这是已经更换完成的效果

下面说步骤:

1.查看本机curl 版本

curl -V  

curl 7.19.7 (x86_64-unknown-linux-gnu) libcurl/7.19.7 OpenSSL/1.0.2k zlib/1.2.7 libidn/1.28

Protocols: tftp ftp telnet dict http file https ftps

Features: IDN IPv6 Largefile NTLM SSL libz

2.下载

wget -c  http://curl.haxx.se/download/a ... ar.gz

3.解压

tar -zxf curl-7.19.7.tar.gz

4.编译安装

cd curl-7.19.7

./configure --without-nss --with-ssl

make && make install

说明:–without-nss 禁用nss, –with-ssl启用openssl的支持.

5.将curl的库载入动态共享文件,并重新加载

echo "/usr/local/lib" >> /etc/ld.so.conf

ldconfig

这一部很重要,否则php的curl就是不会支持openssl

6.查看新安装后curl的版本

curl -V

curl 7.19.7 (x86_64-unknown-linux-gnu) libcurl/7.19.7 OpenSSL/1.0.2k zlib/1.2.7 libidn/1.28

Protocols: tftp ftp telnet dict http file https ftps

Features: IDN IPv6 Largefile NTLM SSL libz

7.重启你的httpd/nginx服务和php服务器

service nginx restart #或service httpd restart

service php-fpm restart

作者:chinariver
链接:https://www.jianshu.com/p/3765bff817aa
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
 
0
2019-07-28

0 个评论

要回复文章请先登录注册