未捕获的CurlException:77:错误设置证书验证位置

I keep getting this same error. I just installed the SSL and no luck. I have checked out all the other posts but none of the solutions seemed to work for me.

Does anyone know what should I be doing ?

Fatal error: Uncaught CurlException: 77: error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none thrown in /home/acmesoft/public_html/Oddsmaker/php_sdk/base_facebook.php on line 977

if ($result === false) {
  $e = new FacebookApiException(array(
    'error_code' => curl_errno($ch),
    'error' => array(
    'message' => curl_error($ch),
    'type' => 'CurlException',
    ),
  ));
  curl_close($ch);
  throw $e;
}
curl_close($ch);
return $result;
douxuelv7755
douxuelv7755 看起来重复,尝试:stackoverflow.com/questions/8994059/...
7 年多之前 回复

3个回答

I have the same error with you and this problem was solved, I just put this 2 lines

Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;
Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYHOST] = 2;

after your facebook apps definition

$facebook = new Facebook(array(
  'appId'  => 'xxx',
  'secret' => 'xxx',
  'cookie' => true,
  'perms' => 'publish_stream,read_stream,email',
  'domain' => 'example.com'
))
dsuhx86802
dsuhx86802 小心这个答案; 看下面爱国者的答案。 这是一个糟糕的答案,因为它会将您的应用暴露给中间人(MITM)攻击。
接近 3 年之前 回复
dqx13503925528
dqx13503925528 这对我有帮助!!
6 年多之前 回复
dougui2254
dougui2254 这出现了新下载的facebook php sdk,就像今天的日期一样。 我用了以前下载的副本可能就像4个月前一样,并没有得到这样的错误......无论如何。 你的解决方法对我有用。
大约 7 年之前 回复



Riyanto Wibowo的回应很危险,因为你实际上是在关闭SSL。 警惕走这条路。 来自评论php手册:</ p> \ n


请大家,停止将CURLOPT_SSL_VERIFYPEER设置为false或0.如果您的PHP安装没有最新的CA根证书包,请在curl网站下载该文件并保存 它在您的服务器上:</ p>

http://curl.haxx .se / docs / caextract.html </ p>

然后在php.ini文件中设置它的路径,例如 在Windows上:</ p>

curl.cainfo = c:\ php \ cacert.pem </ p>

关闭CURLOPT_SSL_VERIFYPEER允许中间人(MITM)攻击, 你不想要的!</ p>
</ blockquote>

我会把它作为评论发布,但我没有足够的声誉。</ p>
</ div >

展开原文

原文

Riyanto Wibowo's response is dangerous because you're essentially turning off SSL. Be wary of taking that route. From a comment on the php manual:

Please everyone, stop setting CURLOPT_SSL_VERIFYPEER to false or 0. If your PHP installation doesn't have an up-to-date CA root certificate bundle, download the one at the curl website and save it on your server:

http://curl.haxx.se/docs/caextract.html

Then set a path to it in your php.ini file, e.g. on Windows:

curl.cainfo=c:\php\cacert.pem

Turning off CURLOPT_SSL_VERIFYPEER allows man in the middle (MITM) attacks, which you don't want!

I would have posted this as a comment but I don't have enough reputation.

douming4359
douming4359 更好地危险地让该死的东西工作,然后没有它的工作。 人们不得不做这个废话以突破功能阻力是curl.haxx.se(或任何人制造它)的错,而不是他们自己。
2 年多之前 回复



您只需要将fb_ca_chain_bundle.crt放在与base_facebook.php相同的文件夹中。 你可以在这里得到它: https://github.com /facebook/facebook-php-sdk/blob/master/src/fb_ca_chain_bundle.crt </ p>
</ div>

展开原文

原文

You just need to have fb_ca_chain_bundle.crt in the same folder as base_facebook.php. You can get it here: https://github.com/facebook/facebook-php-sdk/blob/master/src/fb_ca_chain_bundle.crt

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐