美文网首页
升级php cURL

升级php cURL

作者: builder | 来源:发表于2019-05-19 22:47 被阅读0次

curl是默认使用yum安装SSL version为NSS,现有项目需要支持OpenSSL。
下载最新的curl:https://curl.haxx.se/download/curl-7.64.1.tar.gz
删掉旧版的curl

[root@host curl-7.64.1]# rpm -qa |grep curl

libcurl-7.29.0-51.el7.x86_64
curl-7.29.0-51.el7.x86_64
python-pycurl-7.19.0-19.el7.x86_64
libcurl-devel-7.29.0-51.el7.x86_64

[root@host curl-7.64.1]# rpm -e curl-7.29.0-51.el7.x86_64 --nodeps

安装curl

[root@host curl-7.64.1]# ./configure --prefix=/usr/local/curl --without-nss --with-ssl
[root@host curl-7.64.1]# make
[root@host curl-7.64.1]# make install

刷新动态库

[root@host curl-7.64.1]# rm -rf /usr/lib64/libcurl.so.4*  #删除原有的动态库
[root@host curl-7.64.1]# ln -s /usr/local/curl/lib/libcurl.so.4* /usr/lib64/  #将新动态库放到对应位置
[root@host curl-7.64.1]# ldconfig #刷新动态库

重启php-fpm

[root@host curl-7.64.1]# service php-fpm restart

查看curl版本

[root@host curl-7.64.1]# php -info |grep cURL

cURL support => enabled
cURL Information => 7.64.1

[root@host curl-7.64.1]# php -info |grep "SSL Version"

SSL Version => OpenSSL/1.0.2k

相关文章

网友评论

      本文标题:升级php cURL

      本文链接:https://www.haomeiwen.com/subject/zeyczqtx.html