Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Oct 2009
    Posts
    438
    Thanks
    9
    Thanked 7 Times in 7 Posts

    Post to Facebook Wall giving cURL error

    All,
    I have the following code:
    PHP Code:
        require_once 'facebook.php';
        
        
    $app_id "1234";
        
    $app_secret "45678";
        
        
    $facebook = new Facebook(array(
         
    'appId' => $app_id,
         
    'secret' => $app_secret,
         
    'cookie' => true
        
    ));
        
            
    $page_id "81918";

        
    $result $facebook->api("/me/accounts?access_token=123456");
        foreach(
    $result["data"] as $page) {
            echo 
    $page["name"];
            if(
    $page["id"] == $page_id) {
                
    $page_access_token $page["access_token"];
                break;
            }
        }
        
    $args = array(
            
    'access_token'  => $page_access_token,
            
    'message'       => "I'm a Page!"
        
    );
        
    $post_id $facebook->api("/$page_id/feed","post",$args);
        
    ?> 
    When I execute this, I get the following message:
    Fatal error: Uncaught CurlException: 77: error setting certificate verify locations: CAfile: D:\My Documents\xampp\htdocs\website/fb_ca_chain_bundle.crt CApath: none thrown in D:\My Documents\xampp\htdocs\website\base_facebook.php on line 853

    I'm running XAMPP on my localhost here if that helps anyone.

    I'm not sure why I'm getting this error. Can anyone help me out and let me know what I'm doing wrong? Thanks in advance!

  • #2
    Regular Coder
    Join Date
    Oct 2009
    Posts
    438
    Thanks
    9
    Thanked 7 Times in 7 Posts
    Didn't realize that I needed to get the facebook certificate. The certificate can be found here:

    https://github.com/facebook/php-sdk/...ain_bundle.crt

    Just put this in the same directory that you're base_facebook.php file is in.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •