aws emr api 接口开发 curl 60 ,77错误代码

curl 出现错误代码60 ,77

开发日记:aws emr api 接口开发

Today I was trying to consume an external video API for streaming a set of videos; so I got the code for the PHP source, create all my configuration but when I tried to get the actual data from the external server via cURL; I was obtaining nothing; so, in order to get the error’s message, this is what I did:

var_dump(curl_error($ch));

Which basically gets the error after the connection. The message was the following one:

SSL certificate problem: unable to get local issuer certificate

The solution

1) Download the certificate from http://curl.haxx.se/ca/cacert.pem

2) Create a folder under your home:

mkdir /Users/alex/ssl

3) Copy or move the file with the certificate you just downloaded:

mv /Users/alex/Downloads/cacert.pem /Users/alex/ssl

4) Open your php.ini and look for this directive curl.cainfo (the path should vary, depending on your system or meta-package you are using: WAMP, XAMPP, AMPPS have different paths).

[curl]; A defaultvaluefor the CURLOPT_CAINFO option. This is required to be an; absolute path.curl.cainfo =

5) Type there you path to the certificate; for example in my case, this was the configuration I did:

curl.cainfo = /Users/alex/ssl/cacert.pem

6) Restart your Apache.

7) Enjoy!

 

稍后可能会有curl 77的错误:

http://curl.haxx.se/ca/cacert.pem 下载或者复制粘贴成一个cacert.pem文档

如果你的php环境是window 下,用的集成环境xamp 之类的,那么,我建议你们将那个cacert.pem放置到xampp下面,才能解决77的错误

转载于:https://my.oschina.net/linuxphp/blog/785591

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值