A few days ago I released a beta version of a game on Facebook.
Unfortunately, I’m not so lucky, and in the first most important days of the application when users first use it, they keep getting errors resulting from errors on my PHP Apache server which gets the following errors from Facebook API –
-
couldn’t connect to host
-
connect() timed out!
My server runs on a free server I got from Joyent for facebook developers.
I’m not a big expert with web servers so I got no idea if the problems are from my side or Facebook side.
And how can I fix this problem quickly!
Thanks a lot!
Edit:
For some reason I forgot about the code samples and error examples –
Here’s an example for a simple query against facebook –
$session = $facebook->getSession();
$currentID = $facebook->api('/me?fields=id');
Here’s the error stack trace –
couldn't connect to host StackTrace: Array
(
[0] => Array
(
[file] => /users/home/aagnt2sv/web/public/Facebook/facebook-php-sdk-7d538d3/src/facebook.php
[line] => 523
[function] => makeRequest
[class] => Facebook
[type] => ->
[args] => Array
(
[0] => https://graph.facebook.com/me?fields=id
[1] => Array
(
[method] => GET
[access_token] => 104269778819|2.AQAKqpIXE0jqFuoU.3600.1311008400.1-785849095|qxtBqmWWRMc_GpM77CK77RbO4YA
)
)
)
[1] => Array
(
[file] => /users/home/aagnt2sv/web/public/Facebook/facebook-php-sdk-7d538d3/src/facebook.php
[line] => 491
[function] => _oauthRequest
[class] => Facebook
[type] => ->
[args] => Array
(
[0] => https://graph.facebook.com/me?fields=id
[1] => Array
(
[method] => GET
)
)
)
[2] => Array
(
[function] => _graph
[class] => Facebook
[type] => ->
[args] => Array
(
[0] => /me?fields=id
)
)
[3] => Array
(
[file] => /users/home/aagnt2sv/web/public/Facebook/facebook-php-sdk-7d538d3/src/facebook.php
[line] => 444
[function] => call_user_func_array
[args] => Array
(
[0] => Array
(
[0] => Facebook Object
(
[appId:protected] => *censored*
[apiSecret:protected] => *censored*
[session:protected] => Array
(
[uid] => *censored*
[access_token] => 104269778819|2.AQAKqpIXE0jqFuoU.3600.1311008400.1-785849095|qxtBqmWWRMc_GpM77CK77RbO4YA
[expires] => 1311008400
[sig] => ddf14dcaa953cb64d3f98b0649b60613
)
[signedRequest:protected] =>
[sessionLoaded:protected] => 1
[cookieSupport:protected] => 1
[baseDomain:protected] =>
)
[1] => _graph
)
[1] => Array
(
[0] => /me?fields=id
)
)
)
[4] => Array
(
[file] => /users/home/aagnt2sv/web/public/edamometer/EdamometerWS.php
[line] => 31
[function] => api
[class] => Facebook
[type] => ->
[args] => Array
(
[0] => /me?fields=id
)
)
Thanks again!
This was somehow fixed by itself after several days. Maybe it was a temporary problem on my server or on Facebook’s servers.