Php Graph Facebook API在尝试向用户发布时出现cURL错误';长城
全部,, 我有以下代码:Php Graph Facebook API在尝试向用户发布时出现cURL错误';长城,php,facebook-graph-api,curl,Php,Facebook Graph Api,Curl,全部,, 我有以下代码: <?php require_once 'facebook.php'; $app_id = "1234"; $app_secret = "45678"; $facebook = new Facebook(array( 'appId' => $app_id, 'secret' => $app_secret, 'cookie' => true )); $result = $facebook->api("/me/accounts?acc
<?php
require_once 'facebook.php';
$app_id = "1234";
$app_secret = "45678";
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
$result = $facebook->api("/me/accounts?access_token=123456");
foreach($result["data"] as $page) {
echo $page["name"];
$page_id = "81918";
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);
?>
您需要在与base\u facebook.php
相同的文件夹中拥有证书。我没有意识到我需要获得facebook证书。可在此处找到证书:
只要把它放在你的base_facebook.php文件所在的目录中。我有证书吗?我将base_facebook.php和facebook.php都放在我试图从中执行此脚本的同一文件夹中,但您必须在包含这些文件的文件夹中拥有证书。这个证书是用php SDKMIHALIKA编写的,您的意思是像SSL证书一样吗?这是我第一次听说需要证书来执行这个cURL功能?