参考:https://www.latoooo.com/xia_zhe_teng/368.htm

我的系统版本是 Centos 7 64位。
为了方便,先安装常用的开发环境。

yum groupinstall Development tools

1.下载 OpenSSL:

wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz

2.解压 OpenSSL:

tar -xzvf openssl-1.0.2l.tar.gz

3.进入 OpenSSL目录:

cd openssl-1.0.2l

4.配置并编译 OpenSSL:

./config --shared
make && make install

5.下载 curl 库:

wget https://curl.haxx.se/download/curl-7.55.1.tar.gz

6.解压 curl 库:

tar -xzvf curl-7.55.1.tar.gz

7.进入 curl 目录:

cd curl-7.55.1

8.设置动态库路径:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/ssl/lib

9.配置并编译 curl:

./configure --prefix=/usr/local/curl/ --without-nss --with-ssl=/usr/local/ssl/
make && make install

10.备份默认的 curl 二进制文件

mv /usr/bin/curl /usr/bin/curl.bak

11.做一个新的 curl 软链

ln -s /usr/local/curl/bin/curl /usr/bin/curl

总体的替换到此就完成,可以执行 curl --version 来进行确认。下边是我执行的结果:

curl 7.55.1 (x86_64-pc-linux-gnu) libcurl/7.55.1 OpenSSL/1.0.2l
Release-Date: 2017-08-14
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets HTTPS-proxy

如果你在linux服务器经常需要安装新的php应用,那难免会遇到需要重新编译php,给它增加新的功能的情况。重新编译php后,一方面需要替换掉原来的php,另一方面需要保障其他在线网站的正常运转,就需要对php进行平滑替换了。这个过程该如何进行呢?给出一点我在这方面积累的经验。

找出原来php的配置参数

~:php -i|grep configure
./configure  '--prefix=/usr/local/php' '--with-freetype-dir=/usr/local/freetype' '--with-gd' '--with-gettext' '--with-iconv-dir' '--with-mysqli' '--with-openssl' '--with-pcre-regex' '--with-pdo-mysql' '--with-pdo-sqlite' '--with-pear' '--with-png-dir=/usr/local/libpng' '--with-jpeg-dir=/usr/local/libjpeg' '--with-xsl' '--with-zlib' '--enable-fpm' '--enable-bcmath' '--enable-libxml' '--enable-inline-optimization' '--enable-gd-native-ttf' '--enable-mbregex' '--enable-mbstring' '--enable-opcache' '--enable-pcntl' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvsem' '--enable-xml' '--enable-zip' '--with-curl=/usr/local/curl'

重启php-fpm  /usr/local/php/sbin/php-fpm

Centos curl ssl 替换 NSS 为 OpenSSL的更多相关文章

  1. 更新centos curl

    centos curl 默认使用nss,而不是openssl 升级curl让curl支持openssl rpm -Uvh http://www.city-fan.org/ftp/contrib/yum ...

  2. 执行curl -sSL 提示curl: (35) SSL connect error

    今天,添加容器节点报错,执行如下 curl -sSL https://shipyard-project.com/deploy| ACTION=node DISCOVERY=etcd://192.168 ...

  3. 关于x509、crt、cer、key、csr、pem、der、ssl、tls 、openssl等

    关于x509.crt.cer.key.csr.pem.der.ssl.tls .openssl等 TLS:传输层安全协议 Transport Layer Security的缩写 TLS是传输层安全协议 ...

  4. nginx 编译某个模板的问题./configure: error: SSL modules require the OpenSSL library. You can either do not enable the modules, or install the OpenSSL library into the system, or build the OpenSSL library stati

    root@hett-PowerEdge-T30:/usr/local/src/nginx-1.9.8# ./configure --prefix=/usr/local/nginx  --add-mod ...

  5. centos curl版本nss改成openssl

    在centos 6.2的系统里面的curl支持的https是nss版本的,而不是openssl的,所以在php使用curl访问https的时候会报Unable to load client key - ...

  6. CentOS 6.8 curl支持的NSS修改为OpenSSL的方法

    在CentOS 6.8的系统里面的curl支持的https是nss版本的,而不是openssl,所以在php使用curl访问https的时候会报Unable to load client key -8 ...

  7. 在Windows上编译最新的CURL,含有zlib,openssl

    最近,从网上下载了一个curl库,使用时各种报错,都无法启动,于是干脆就直接自己编译了. 1. 准备工作 a. 下载zlib zlib可以使得HTTP请求支持gzip压缩,其地址如下: 官网:http ...

  8. php下curl ssl常用问题

    1. 查看curl版本 在phpinfo中,可以查看 curl cURL support enabled cURL Information 7.35.0 Age 3 Features AsynchDN ...

  9. centos下从源码安装openssl

    cd /usr/src wget https://www.openssl.org/source/openssl-1.0.1g.tar.gz -O openssl-1.0.1g.tar.gz tar - ...

随机推荐

  1. Delphi 资源管理器套件

    需要个类似资源管理器的东西, 首先试了下 TDriveComboBox.TDirectoryListBox.TFileListBox, 嘿! Win31 时代的东西, 不是一般地丑. 试了下 Vcl. ...

  2. 开源的服务发现项目Zookeeper,Doozer,Etcd - 木精灵的技术博客 - CSDN博客

    开源的服务发现项目Zookeeper,Doozer,Etcd - 木精灵的技术博客 - CSDN博客   http://blog.csdn.net/shlazww/article/details/38 ...

  3. 10 个理由让你继续干 IT

    1.钱,钱,钱 对,我们努力工作就是为了赚钱,而IT专业人士的努力工作的确得到了很好的补偿.报酬不仅仅是好而已,而是非常棒.根据美国劳工部<2010年美国 就业与报酬情况概览>(表6,PD ...

  4. SWD and JTAG selection mechanism

    SWD and JTAG selection mechanism SWJ-DP enables either an SWD or JTAG protocol to be used on the deb ...

  5. 找不到包含 OwinStartupAttribute 的程序集

    配置一个 MVC 项目时 遇到的  vs 2013 解决办法:在 webconfig 中 <appSettings> <add key="owin:AutomaticApp ...

  6. [Go] md5 加密 示例

    package main import ( "crypto/md5" "encoding/hex" "fmt" "io" ...

  7. mixpanel实验教程(1)

    一.关于 mixpanel 这个我不想多说,不明确请看官方手冊:https://mixpanel.com/help/reference/ 二.注冊 mixpanel.com 是一个商业机构.它的用户分 ...

  8. MAC系统压缩文件传到WINDOWS下出现乱码

    可能使用Mac系统的朋友,在压缩文件时遇到过这样的问题: 要给朋友传文件,而对方又是WIN系统.我们打好包传过去以后,对方解压缩发现中文文件名都成乱码了.这是怎么回事? 原来,Mac下,默认文字编码是 ...

  9. Git:一本书 + 一个站点,让你掌握 Git

    一本书:<<Pro Git in Chinese>> 一个网站:http://pcottle.github.io/learnGitBranching/

  10. 关于面试总结3-SQL查询

    前言 select top n 形式的语句可以获取查询的前几个记录,但是 mysql没有此语法,mysql用limit来实现相关功能. LIMIT子句可以被用于强制 SELECT 语句返回指定的记录数 ...