$photo_details = array(
'message'=> $image->description().' '.$site_adr.$image->id().'/'.cleanSEOstring(strtolower(trim($image->title()))).'-cover-photo',
'redirect_uri'=> 'http://www.exampleurl.com',
'scope'=>'publish_stream');
$photo_details['image'] = '@' . realpath($photo);
try
{
$upload_photo = $facebook->api('/'.$album_uid.'/photos', 'POST', $photo_details);
@unlink($file);
header('location:https://www.facebook.com/profile.php?id='.$userMe['id'].'&v=wall');
}
catch(FacebookApiException $e)
{
header('location:http://www.somethingwentwrong.com');
}
它仍然重定向到somethingwentwrong.com,我做错了什么吗?
如标题中所述的异常是“发生了未知错误”,这是它在 catch 语句中返回的对象:
object(FacebookApiException)#5 (7) { ["result:protected"]=> array(1) { ["error"]=> array(3) { ["message"]=> string(30) "An unknown error has occurred." ["type"]=> string(14) "OAuthException" ["code"]=> int(1) } } ["message:protected"]=> string(30) "An unknown error has occurred." ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(48) "/var/www/mysite/fb-sdk/base_facebook.php" ["line:protected"]=> int(1106) ["trace:private"]=> array(4) { [0]=> array(6) { ["file"]=> string(48) "/var/www/mysite/fb-sdk/base_facebook.php" ["line"]=> int(810) ["function"]=> string(17) "throwAPIException" ["class"]=> string(12) "BaseFacebook" ["type"]=> string(2) "->"