简体   繁体   中英

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. 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

I would like to mention that I've added an SSL certificate to my website. It seems that Facebook SDK is using the default location for certificates. 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 ?

Many Thanks.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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