简体   繁体   English

使用Facebook PHP SDK张贴到用户墙时出现证书错误

[英]certificate error while posting to user wall with facebook php sdk

I m using the PHP facebook sdk v3.0.0 to post comments on Facebook user's wall. 我正在使用PHP facebook sdk v3.0.0在Facebook用户墙上发布评论。 Here is the code used: 这是使用的代码:

    $args = array(
        "message" => $message,
        "link" => $link,
        "Caption" => $messageCaption,
    );
    try {
        $postId = $this->api("/$userFBId/feed", "post", $args);
        return $postId;
    } catch (FacebookApiException $e) {
        throw $e;
    }    

When I execute it, I got the following error message: 当我执行它时,出现以下错误信息:

error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none 错误设置证书验证位置:CAfile:/etc/pki/tls/certs/ca-bundle.crt CApath:无

I would like to mention that I've added an SSL certificate to my website. 我想提及的是,我已经在网站上添加了SSL证书。 It seems that Facebook SDK is using the default location for certificates. 看来Facebook SDK正在使用默认位置的证书。 But I'm on a shared server and the certificate file is located in a customized folder. 但是我在共享服务器上,证书文件位于自定义文件夹中。

Please, how to solve this issue ? 请,如何解决这个问题? Is there a way to specify to facebook SDK how to use a customized file for CAfile and CApath ? 有没有一种方法可以向facebook SDK指定如何对CAfile和CApath使用自定义文件?

Many Thanks. 非常感谢。

经过一段时间的努力之后,我认为我应该回答一下,以帮助他人解决该问题,就像我能够做到的一样:将fb_ca_chain_bundle.crt保存在与base_facebook.php相同的路径中,还可以直接从developers.facebook的sdk位置下载fb_ca_chain_bundle.crt。 .com,而不是包括github在内的任何其他网站。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM