The problem is that after authenticating an user using $facebook->getLoginUrl(), the subsequent $facebook->getUser() call would fail, retuning 0.
The issue is with the PHP SDK, which relies on $_REQUEST from the server, which has changed in PHP 5.4.0 because of default php.ini settings having been changed.
use :
protected function get_code() {
$server_info = array_merge($_GET, $_POST, $_COOKIE);
if (isset($server_info['code'])) {
if ($this->state !== null && isset($server_info['state']) && $this->state ===server_info['state']) {
$this->state = null;
$this->clearPersistentData('state');
return $server_info['code'];
}
else {
return false;
}
}
return false;
}