I am trying to get a profile picture of a page using the api and php graph, and I did it like this:
$getBigImage = get_headers('https://graph.facebook.com/'.$PID.'/picture?type=large&access_token='.$this->token.'',1);
$data['fbBigImage'] = $getBigImage['Location'];
My problem starts when I sometimes get an error:
[13-Sep-2015 08:19:37 America/New_York] PHP Warning: get_headers(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in line 252
[13-Sep-2015 08:19:37 America/New_York] PHP Warning: get_headers(https://graph.facebook.com/1437355116498102/picture?type=large&access_token=***): failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in line 252
I need to use another method or a good alternative to get_headers, as it sometimes fails (in most cases it works, but I need to work something with 100% of cases)
Thanks!
source
share