centos curl版本nss改成openssl
在centos 6.2的系统里面的curl支持的https是nss版本的,而不是openssl的,所以在php使用curl访问https的时候会报Unable to load client key -8178的错误,在google group里面找到了灵感,也是curl和https的,里面说倒是curl的问题:
https://groups.google.com/forum/?fromgroups=#!topic/pongba/sgMYM9dGI7k
根据链接里面说的,去官网下载了一个最新版本(curl-7.28.1.tar.gz)的curl,来进行源码编译。
编译的依赖,openssl和openssl-devel。
编译方法和其他软件类似,步骤如下:
去到源码目录:curl-7.28.1
./configure --without-nss --with-ssl && make &&make install 即可完成编译。
然后是把curl的lib添加到PATH中,这个也是在google group里面说到的。
ldconfig(echo "/usr/local/lib" >> /etc/ld.so.conf && 这个有时候需要重启服务器后,再次执行这个命令.重启有问题,还是按下面的标准更新流程来!)
此时,通过命令行运行php调用curl 带证书访问web的php程序可以正常了。但是通过web界面还是之前那个Unable to load client key -8178 问题,需要重新编译php。
====
最新流程2018-05-14
先yum update openssl
再yum update curl
curl -V
如果直接显示已经是OpenSSL版本了
重启一下php-fpm即可,不需要下面的方式。。。
上面的yum方式不行的话,走这个更新流程
1、系统的curl生成
wget http://curl.haxx.se/download/curl-7.35.0.tar.gz
tar -zxvf curl-7.35.0.tar.gz
cd curl-7.35.0.tar.gz
cd /www/src/curl-7.39.0
./configure --prefix=/usr/local/curl --without-nss --with-ssl
make && make install
备份默认的curl二进制文件
sudo mv /usr/bin/curl /usr/bin/curl.bak
然后做一个新的curl软链
sudo ln -s /usr/local/curl/bin/curl /usr/bin/curl
然后再curl --version确认是否已经是openssl的版本
2、生成curl.so
cd /www/src/lanmp/php-5.2.17/ext/curl
/www/wdlinux/php/bin/phpize
./configure --with-php-config=/www/wdlinux/php/bin/php-config --with-curl=/usr/local/curl/
make && make install
3、重新编译php(php.ini找出原先的配置参数,复制,去掉with-curl,然后编译
cd /www/src/lanmp/php-5.2.17/
./configure '--prefix=/www/wdlinux/apache_php-5.2.17' '--with-config-file-path=/www/wdlinux/apache_php-5.2.17/etc' '--with-mysql=/www/wdlinux/mysql' '--with-iconv=/usr' '--with-mysqli=/www/wdlinux/mysql/bin/mysql_config' '--with-pdo-mysql=/www/wdlinux/mysql' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-discard-path' '--enable-inline-optimization' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-ftp' '--enable-bcmath' '--enable-exif' '--enable-sockets' '--enable-zip' '--with-apxs2=/www/wdlinux/apache/bin/apxs'
4、编译完后,在php.ini里增加
extension=curl.so
重启php-fpm即可
=====
如果你在linux服务器经常需要安装新的php应用,那难免会遇到需要重新编译php,给它增加新的功能的情况。重新编译php后,一方面需要替换掉原来的php,另一方面需要保障其他在线网站的正常运转,就需要对php进行平滑替换了。这个过程该如何进行呢?给出一点我在这方面积累的经验。
1、找出原来php的配置参数
~:php -i|grep configure
Configure Command => './configure' '--prefix=/usr/local/php' '--enable-mbstring' '--enable-fastcgi' '--enable-fpm' '--with-curl' '--with-mysql=/usr/local/mysql' '--with-mysqli=/usr/local/mysql/bin/mysql_config'
./configure '--prefix=/www/wdlinux/apache_php-5.2.17' '--with-config-file-path=/www/wdlinux/apache_php-5.2.17/etc' '--with-mysql=/www/wdlinux/mysql' '--with-iconv=/usr' '--with-mysqli=/www/wdlinux/mysql/bin/mysql_config' '--with-pdo-mysql=/www/wdlinux/mysql' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-discard-path' '--enable-inline-optimization' '--with-curl=/usr/local/curl' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-ftp' '--enable-bcmath' '--enable-exif' '--enable-sockets' '--enable-zip' '--with-apxs2=/www/wdlinux/apache/bin/apxs'
centos curl版本nss改成openssl的更多相关文章
- 把centos 网卡接口eth2改成eth0
kvm 虚拟机 复制之后 默认网卡是 eth2了 用 ifconfig -a 命令查看所有的网络设置,果然没有eth0的相关设置,多出来一个eth2.显示如下:[root@neal ~]# ifcon ...
- python改成了python3的版本,那么这时候yum就出问题了
既然把默认python改成了python3的版本,那么这时候yum就出问题了,因为yum貌似不支持python3,开发了这个命令的老哥也不打算继续写支持python3的版本了,所以,如果和python ...
- MFC下debug改成release版本出现问题及解决办法
自己在debug下成功运行了自己写的测试自己写第三方库的程序,这里有用到opencv库,所以同时用到了自己的库和opencv的库,需求因为要进行速度的测试,是想要把debug改成release版本,这 ...
- 复利计算5.0(改成Java版本)与 单元测试
//由于C语言版本不方便单元测试,所以改成了java版本,部分代码如下:import java.util.Scanner; public class FuLi{ public static void ...
- centos 升级curl版本
1.安装repo rpm -Uvh http://www.city-fan.org/ftp/contrib/yum-repo/rhel6/x86_64/city-fan.org-release-2-1 ...
- 【转】centos升级curl版本
1.安装repo rpm -Uvh http://www.city-fan.org/ftp/contrib/yum-repo/rhel6/x86_64/city-fan.org-release-2-1 ...
- Cocos2dx 3.1.1 将一个2.X的项目改成3.1版本
最近在论坛上下载到了一个Cocos2dx的单机跑酷例子, 也不知道是2.x版的, 花了一天时间试着把他改成3.1.1的试试, 现在已经可以顺利编译的, 但是还是有Heap Free的问题,调试了好几天 ...
- java1.8 版本改成 java1.7版本
以前先安装的java1.7 大部分程序应该都是只支持1.7 不支持1.8 但是因为要跑一个别人的项目 要求是java1.8 所以想在电脑上同时装1.7和1.8 到官网上下载1.8 安装 安装完成后 并 ...
- 更新centos curl
centos curl 默认使用nss,而不是openssl 升级curl让curl支持openssl rpm -Uvh http://www.city-fan.org/ftp/contrib/yum ...
随机推荐
- 第一个Sprint冲刺第四天
讨论成员:邵家文.李新.朱浩龙.陈俊金 讨论问题:掌握计时技术的知识 讨论地点:qq网络 进展:即将开始对计时技术代码的编写
- 关于OC队列
GCD中有三种队列类型: The main queue: 与主线程功能相同.实际上,提交至main queue的任务会在主线程中执行.main queue可以调用dispatch_get_main_q ...
- 用 CSS 实现字符串截断
[要求]:如何用css实现字符串截断,超出约定长度后用缩略符...代替? ♪ 答: <html> <head> <meta charset="UTF-8&q ...
- Sharded实现学习-我们到底能走多远系列(32)
我们到底能走多远系列(32) 扯淡: 工作是容易的赚钱是困难的 恋爱是容易的成家是困难的 相爱是容易的相处是困难的 决定是容易的可是等待是困难的 主题: 1,Sharded的实现 Sharded ...
- [转载]NoSQL by Martin Flower
============================================================== URL1 nosql ========================== ...
- centos 服务器操作
CENTOS下创建FTP登录用户 yum install vsftpd2.启动/重启/关闭vsftpd服务器[root@localhost ftp]# /sbin/service vsftpd re ...
- 238. Product of Array Except Self
Given an array of n integers where n > 1, nums, return an array output such that output[i] is equ ...
- ZOJ 1113 u Calculate e
原题链接 题目大意:迭代求自然常数e. 解法:没什么好说的,注意数据类型和输出格式. 参考代码: #include<stdio.h> #include<math.h> int ...
- sgu551 Preparing Problem
题目链接:http://acm.sgu.ru/problem.php?contest=0&problem=551 呵呵,题目读的没错,可惜理解错了..== #include <cstdi ...
- js部分---类型,变量;
<script type="text/javascript">1.注释:用“//或者/**/”2.数据类型: (1)整型 int (2)小数类型 单精度float 双精 ...