I am using Facebook API code to publish a post on pages. But occurred the error.
I've uploaded the code on my domain even I am getting this problem.
Graph returned an error: (#200) The user hasn't authorized the application to perform this action
FB API Code:
<?php
require_once(__DIR__."/fb-sdk/src/Facebook/autoload.php");
$fb = new Facebook\Facebook([
'app_id' => 'MY_APP_ID',
'app_secret' => 'MY_SECRET',
'default_graph_version' => 'v2.2',
]);
$linkData = [
'link' => 'www.mywebsite.com',
'message' => 'Testing API'
];
$pageAccessToken ='MY_ACCESS_TOKEN';
try {
$response = $fb->post('/me/feed', $linkData, $pageAccessToken);
}
catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: '.$e->getMessage();
exit;
}
catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: '.$e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
?>
You can see the advance setting of API in the image, is there anything missing in code or settings?

You can Follow this tutorial
http://www.discussdesk.com/post-into-facebook-page-using-graph-api-with-php.htm
To post to a Page "as Page", you need to authorize the user with "publish_pages" and you need to use a Page Token. Try to add publish_pages to your permission list:
$config['facebook']['permissions'] = array(
'email',
'user_location',
'user_birthday',
'publish_actions',
'publish_pages',
'manage_pages',
'public_profile',
);