title: Failed to connect to graph.facebook.com port 443: Connection refused
body: <p>I am new to FB graph API and I try to include the FB login in my website, I following the official FB login tutorial from their website, But after login I get the following error:<br/></p>
  
  <pre><code>Failed to connect to graph.facebook.com port 443: Connection refused
  </code></pre>
  
  <p>Login.php<br/></p>
  
  <pre><code>&lt;?php
  session_start();
  require_once __DIR__ . '/fbsdk/src/Facebook/autoload.php';
  
  $fb = new Facebook\Facebook([
  'app_id' =&gt; 'xxx',
  'app_secret' =&gt; 'xxx',
  'default_graph_version' =&gt; 'v2.3',
  // . . .
  ]);
  
  $helper = $fb-&gt;getRedirectLoginHelper();
  $permissions = ['public_profile', 'email']; // optional
  $loginUrl = $helper-&gt;getLoginUrl('http://-myserver-/login-callback.php',    $permissions);
  
  echo '&lt;a href="' . $loginUrl . '"&gt;Log in with Facebook!&lt;/a&gt;';
  ?&gt;
  </code></pre>
  
  <p>login-callback.php</p>
  
  <pre><code>&lt;?php
  session_start();
  require_once __DIR__ . '/fbsdk/src/Facebook/autoload.php';
  
  $fb = new Facebook\Facebook([
  'app_id' =&gt; 'xxx',
  'app_secret' =&gt; 'xxx',
  'default_graph_version' =&gt; 'v2.3',
  // . . .
  ]);
  
  
  
  $helper = $fb-&gt;getRedirectLoginHelper();
  try {
  $accessToken = $helper-&gt;getAccessToken();
  } catch(Facebook\Exceptions\FacebookResponseException $e) {
  // When Graph returns an error
  echo 'Graph returned an error: ' . $e-&gt;getMessage();
  exit;
  } catch(Facebook\Exceptions\FacebookSDKException $e) {
  // When validation fails or other local issues
  echo 'Facebook SDK returned an error: ' . $e-&gt;getMessage();
  exit;
  }
  
  if (isset($accessToken)) {
  // Logged in!
  $_SESSION['facebook_access_token'] = (string) $accessToken;
  
  // Now you can redirect to another page and use the
   // access token from $_SESSION['facebook_access_token']
  }
  ?&gt;
  </code></pre>
  
  <p>example-canvas-app.php</p>
  
  <pre><code>&lt;?php
  session_start();
  require_once __DIR__ . '/fbsdk/src/Facebook/autoload.php';
  
  $fb = new Facebook\Facebook([
  'app_id' =&gt; 'xxx',
  'app_secret' =&gt; 'xxx',
  'default_graph_version' =&gt; 'v2.3',
  // . . .
  ]);
  
  
  
  $helper = $fb-&gt;getCanvasHelper();
  try {
  $accessToken = $helper-&gt;getAccessToken();
  } catch(Facebook\Exceptions\FacebookResponseException $e) {
  // When Graph returns an error
  echo 'Graph returned an error: ' . $e-&gt;getMessage();
  exit;
  } catch(Facebook\Exceptions\FacebookSDKException $e) {
  // When validation fails or other local issues
  echo 'Facebook SDK returned an error: ' . $e-&gt;getMessage();
  exit;
  }
  
  if (isset($accessToken)) {
  // Logged in.
  }
  ?&gt;
  </code></pre>
  
  <p>I already searched in stack and google but I can't find any solution</p>