This piece of code used to work as expected, but now it seems i can\'t retrieve the user name the same way:
$uid = $facebook->getUser(); // returns the faceb
Facebook use CURL for send request to server, maybe curl on your server not work or curl_exec is disabled