title: Fatal error: Uncaught CurlException: 7: couldn't connect to host thrown in ....src/base_facebook.php on line 887
body: <p>I'm trying to develop a sample facebook php login example following the example <a href="http://www.designaesthetic.com/2012/03/02/create-facebook-login-oauth-php-sdk/" rel="nofollow noreferrer">here</a></p>
  
  <p>I've hosted my app <a href="http://cse591.host56.com/" rel="nofollow noreferrer">here</a>, but I'm getting the error message in the question whenever I try to access the link. Here's the code segment that throws the error</p>
  
  <pre><code>try {
    $e = new FacebookApiException(array(// LINE 887
               'error_code' =&gt; curl_errno($ch),
               'error' =&gt; array(
               'message' =&gt; curl_error($ch),
               'type' =&gt; 'CurlException',
          ),
    ));
    curl_close($ch);
  }
  
  // edit suggested by Kneel-before ZOD
  catch(FacebookApiException $e) {
    $result = $e-&gt;getResult();
    echo 'Got an : ', $e-&gt;getType(),' while posting';
    echo(json_encode($result));
  }
  
  catch(Exception $e){
    echo 'Caught exception: ',  $e-&gt;getMessage(), "\n";
  }
  </code></pre>
  
  <p>Im quite sure Ive setup the APP ID and secret correctly in index.php.</p>
  
  <p>Here's a screenshot of my app setup on facebook<img src="https://i.stack.imgur.com/u59Bj.png" alt="App setup"></p>
  
  <p>Any help would be appreciated. Thanks!</p>