I am trying to get facebook access token
But the url when executed from browser and local machine php script returns true data values. However, when i run the same script from server, it fails and shows bool(false)
the url
$token_url = "https://graph.facebook.com/oauth/access_token?"
. "client_id=".$config['appId']."&redirect_uri=" . urlencode($config['callback_url'])
. "&client_secret=".$config['secret']."&code=" . $_GET['code'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $token_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$response = curl_exec ($ch);
var_dump($response);
Other urls work on the server.
What is wrong here ?