<?php
require_once("facebook.php"); // set the right path
$config = array();
$config['appId'] = '';
$config['secret'] = '';
$config['fileUpload'] = false; // optional
$fb = new Facebook($config);
$params = array(
// this is the main access token (facebook profile)
"access_token" => "EAAHHbZBnyVlsBAFx1X4LVrxouuTYZB5IDsd7PI2FQica9tqNNvzInPKP9KHPQKJPfxITGy6ZCuSjOFPChrD4f5damVXSeC2O6w7BZATUNp7s8nTZBVn8ZBdyKuVpbQeTU4mZBVrUJ92IUwP7Ubli9JJuUrtqZAwOe1ZCv751ZBNOoO80fXyATn0ztaU8OQZD",
"message" => "",
"name" => "",
"caption" => "",
"description" => ""
);
try {
$ret = $fb->api('/me/feed', 'POST', $params);
echo 'Successfully posted to Facebook Personal Profile';
} catch(Exception $e) {
echo $e->getMessage();
}
?>
I have created a server-side PHP app that posts status automatically on my FB page but When I run the app, it shows an error message:
Error validating access token: Session has expired