PHP 5.6 开启CURL HTTPS 类型
前几日要写微信支付接口,微信支付接口CURL地址是HTTPS。本机测试的是OK的,但是服务器缺提示错误--“ Protocol https not supported or disabled in libcurl”;
纠结了半天是因为curl不支持https ,并且在phpinfo 中查看 curl模块,确实HTTPS 是No。
所以,要开启curl 的HTTPS,
因为自己安装PHP是对于curl 随意安装,重装PHP比较麻烦,又得重装很多扩展所以,干脆找了一个办法,下载新的CURL和openssl libssh2 等新库 ,进行依赖安装。
安装过程中,出现了各种问题,比如:
/lib/.libs/libcurl.so: undefined reference to `SSLv2_client_method’
这个错误百度了好半天,才知道在curl7.21.5以后已经发生了变化,所以下载了新的包“curl-7.42.1” 安装
在安装curl 之前 肯定要有openssl 的存在。
解压tar.gz的curl包,./configure 提示下图,说明成功:
然后make make install 即可。
如果系统有其他版本的存在,有一个很简单的办法去掉,那就是改名,安装新的版本的默认目录
比如我就是把/usr/local/bin/curl 改为curl2 然后新的版本安装目录设置为/usr/local/bin/curl 或者不设置,让他默认就可以了。
安装openssl 之后,切记要注意,在配置文件/etc/ld.so.conf中添加配置库目录,并且ldconfig 重新加载配置。
另外,linux 查看某些安装目录 用which搜一下,还是不错的。
提供我的php5.6 可安装使用的包。
wget http://curl.haxx.se/download/curl-7.42.1.tar.gz
PHP 5.6 开启CURL HTTPS 类型的更多相关文章
- file_get_contents无法请求https连接的解决方法 php开启curl
file_get_contents无法请求https连接的解决方法 方法1: PHP.ini默认配置下,用file_get_contents读取https的链接,就会如下错误: Warning: fo ...
- php开启curl和openssl
php开启curl和openssl 开启php curl函数库的步骤 1).去掉windows/php.ini 文件里;extension=php_curl.dll前面的; /*用 echo phpi ...
- PHP开启cURL功能
PHP开启cURL功能 在php.ini中开启 确定php扩展目录下有php_curl.dll类库 在php.int中找到扩展库所在目录 判断目录下是否有php_curl.dll 没有的话去搜索下载 ...
- PHP curl https访问问题
PHP curl https访问问题,原代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 /* @String url URL地址 * @Array data P ...
- 开启CURL扩展,让服务器支持PHP curl函数(远程采集)
关于开启Curl的方法模板天下小编在此给大家简单说一下 curl().file_get_contents().snoopy.class.php这三个远程页面抓取或采集中用到的工具,默迹还是侵向于用sn ...
- 在PHP中开启CURL扩展,使其支持curl()函数
在用PHP开发CMS的时候,要用到PHP的curl函数,默认状态下,这个函数需要开启CURL扩展,有主机使用权的,可通过PHP.ini文件开启本扩展,方法如下: 1.打开php.ini,定位到;ext ...
- 记一次解决curl https证书问题
问题起因 在访问https的网站时,报出Peer's Certificate has expired的错误.如下: [root@localhost ~]# curl https://www.baidu ...
- linux c++ curl https 请求并双向验证SSL证书
1.配置curl https请求需要提供 CA证书.客户端证书和客户端秘钥,这三个文件的pem格式. 分别对应 curl_easy_setopt() 函数的 下面三个参数: CURLOPT_CAINF ...
- win7 wamp 64位 php环境如何开启curl服务?
这篇文章主要介绍了PHP简单开启curl的方法,较为详细的讲述了PHP开启curl函数库的具体步骤与相关注意事项,需要的朋友可以参考下 本文讲述了PHP简单开启curl的方法.分享给大家供大家参考,具 ...
随机推荐
- Spring Boot application.yml bootstrap.yml
yml与properties 其实yml和properties文件是一样的原理,且一个项目上要么yml或者properties,二选一的存在. 推荐使用yml,更简洁. bootstrap与appli ...
- 开启Centos系统的SSH服务
1.登录Centos6.4系统. ◆示例:使用root用户登录. 注:若为非root用户登录,输入执行某些命权限不够时需加sudo. 查看SSH是否安装. 2.◆输入命令:rpm -qa | grep ...
- Webpack Getting Started
[Webpack Getting Started] Make sure you have a fresh version of Node.js installed. If you are using ...
- pecan API调用
1.在PasteDeploy部署caesar-api服务时,setup_app中建立app,app中设置hooks,hooks负责加载conf配置文件和数据库连接 self.storage_conne ...
- mybatis in查询 传入string
<select id="selectChoosenumberdetailNumber" > SELECT number FROM choosenumberdetail ...
- 站点防火墙api,增加黑名单IP接口,增加用post,修改用put,php案例
<?php $apiHost = "http://192.168.1.198/api2/site/index.php"; $router = "token" ...
- Missing artifact org.hibernate:hibernate-core:jar:4.3.0.Final
Missing artifact org.hibernate:hibernate-core:jar:4.3.0.Final
- STOP OUR NEGATIVE THOUGHTS
Do you ever feel like you're in over your head and at any moment you're going to burst? You're not a ...
- I/O复用之epoll
epoll 简介 epoll是为处理大批量句柄而作了改进的poll,它是在2.5.44内核中被引进的. 相关函数调用 int epoll_create(int size); 创建一个epoll的句柄. ...
- cef研究
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights // reserved. Use of this s ...