-2

I'm trying to add Facebook API on my web application..

But when I tried to post links using the Graph API.. I got this error:

Fatal error: Uncaught exception 'Facebook\FacebookSDKException' with message 'couldn't connect to host' in /home/u614270703/public_html/test/vendor/facebook/php-sdk-v4/src/Facebook/HttpClients/FacebookCurlHttpClient.php:156 Stack trace: #0 /home/u614270703/public_html/test/vendor/facebook/php-sdk-v4/src/Facebook/FacebookRequest.php(248): Facebook\HttpClients\FacebookCurlHttpClient->send('https://graph.f...', 'POST', Array) #1 /home/u614270703/public_html/test/session2.php(32): Facebook\FacebookRequest->execute() #2 {main} thrown in /home/u614270703/public_html/test/vendor/facebook/php-sdk-v4/src/Facebook/HttpClients/FacebookCurlHttpClient.php on line 156

I don't have any idea what is going on. What does this error means? I don't know why I can't 'connect to host'.

tomrozb
  • 25,773
  • 31
  • 101
  • 122
변형빈
  • 3
  • 1
  • 2

1 Answers1

1

Your server probably blocks outgoing CURL requests, contact your provider and ask him if he could open access to the Facebook API server (graph.facebook.com).

There are other threads about this too:

Community
  • 1
  • 1
andyrandy
  • 72,880
  • 8
  • 113
  • 130