Hi I m creating application on facebook using new graph api but it gives error as
curlexception 6: name lookup time out in facebook.php file.
The problem is that same code is works fine on other server and not gives this error. How to solve this error Please help me.
I had this same problem when developing locally on a virtual machine. I solved it by upping my Curl Connect Timeout.
Look for CURLOPT_CONNECTTIMEOUT = 10
in your facebook SDK. Try changing it to CURLOPT_CONNECTTIMEOUT = 30
or CURLOPT_CONNECTTIMEOUT = 60
Update: form Facebook SDK 3.x the CURLOPT_CONNECTTIMEOUT is located in the file base_facebook.php not in the facebook.php.
I believe you can also change the value dynamically as the CURL_OPTS are send every makeRequest (please edit if this is not the case!):
$facebook = new Facebook(array(
'appId' => $your['AppId'],
'secret' => $your['AppSecret'],
'cookie' => true
));
$facebook->CURL_OPTS['CURLOPT_CONNECTTIMEOUT'] = 30;
See also: SSL Connection timeout in facebook fql for other timeout issues :D
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With