Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to connect to 2a03:2880:10:1f03:face:b00c:0:26: Network is unreachable from Facebook PHP SDK

I am using Facebook Current PHP SDK. My app was running ok. BUt from today any api call returning Failed to connect to 2a03:2880:10:1f03:face:b00c:0:26: Network is unreachable.

Here is my code

  try {
    $fbme = $facebook->api('/me');
  } catch (Exception $e) {        
  echo $e->getMessage();        
  }

Is any one having this problem? How can I fix this?

like image 636
Zakir Hyder Avatar asked Jun 12 '12 20:06

Zakir Hyder


2 Answers

There is one more solution for this problem, found it on http://codecorner.galanter.net/2011/06/03/solution-for-wordpress-curl-ipv6-error-network-is-unreachable/

You can simply force IPV4 resolve by setting the following curl option :

curl_setopt( $handle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
like image 124
Le Gnav Avatar answered Oct 20 '22 05:10

Le Gnav


Your server's network or firewall is likely misconfigured; disable your IPV6 interface if you don't have IPV6 connectivity

like image 29
Igy Avatar answered Oct 20 '22 07:10

Igy