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/archeology/curl-7.19.7.tar.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
参考以下命令:
PHP-FPM状态管理:/etc/init.d/php-fpm {start|stop|quit|restart|reload|logrotate}
Nginx状态管理:/etc/init.d/nginx {start|stop|reload|restart}
MySQL状态管理:/etc/init.d/mysql {start|stop|restart|reload|force-reload|status}
Memcached状态管理:/etc/init.d/memcached {start|stop|restart}
PureFTPd状态管理: /etc/init.d/pureftpd {start|stop|restart|kill|status}
ProFTPd状态管理: /etc/init.d/proftpd {start|stop|restart|reload}
Redis状态管理: /etc/init.d/redis {start|stop|restart|kill}