Solving Uncaught CurlException: name lookup timed out in facebook.php
If you are facebook developer, and are using the latest facebook php sdk, facebook.php grabbed from github.com, and are facing the problem similiar to as defined below:
PHP Fatal error: Uncaught CurlException: 6: name lookup timed out thrown in /<location>/facebook.php on line 592
This is probably the host is not given enough time to contact with facebook server. To solve this problem, open facebook.php with your editor, and go to line 89 to find the code below:
public static $CURL_OPTS = array( CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 60, CURLOPT_USERAGENT => 'facebook-php-2.0', );
Modify CURLOPT_CONNECTION to increase its value to, 30 or higher.
CURLOPT_CONNECTTIMEOUT => 30,
and test your facebook application again to see if it works.
Suggestion: Change to a better host to resolve the problem without modifying the facebook.php script
My Facebook Application
Recently I have setup a facebook application namely "In Between", a simple card game which might not so well-known yet. If you are interested to learn how to play this card game, go to http://apps.facebook.com/in_between/. Of course, you need to have a facebook account to play the game.
If everything works fine, I would like to share my experience and steps/guideline to setup a new facebook application here, as I have gone through a lot of issues to integrate with facebook platform and scratch my head everyday.
Like