title: Fatal error: Uncaught exception 'Google_IOException'
body: <p>I am trying to make work a php code for listing the users of  a google user. I have followed a <a href="http://www.youtube.com/watch?v=SScwYK-te-g" rel="nofollow">youtube tutorial</a> and tryed the solutions proposed in <a href="http://25labs.com/tutorial-implementing-google-api-using-oauth-2-0-in-php/" rel="nofollow">this one</a>  But I still get this annoying error when I call the authenticate method :</p>
  
  <pre><code>Fatal error: Uncaught exception 'Google_IOException' with message 'HTTP Error: (0) couldn't connect to host' in D:\xampp\htdocs\yac\proxy\lib\google-api-client\io\Google_CurlIO.php:128 Stack trace: #0 D:\xampp\htdocs\yac\proxy\lib\google-api-client\auth\Google_OAuth2.php(103): Google_CurlIO-&gt;makeRequest(Object(Google_HttpRequest)) #1 D:\xampp\htdocs\yac\proxy\lib\google-api-client\Google_Client.php(131): Google_OAuth2-&gt;authenticate(Array, NULL) #2 D:\xampp\htdocs\yac\proxy\contacts.php(36): Google_Client-&gt;authenticate() #3 {main} thrown in D:\xampp\htdocs\yac\proxy\lib\google-api-client\io\Google_CurlIO.php on line 128
  </code></pre>
  
  <p>here is my PHP code :</p>
  
  <pre><code>&lt;?php
  session_start();
  
  require_once 'lib/google-api-client/Google_Client.php';
  
  $client = new Google_Client();
  $client-&gt;setApplicationName("Contactoos");
  $client-&gt;setClientId('*************************************');
  $client-&gt;setClientSecret('*********************************');
  $client-&gt;setScopes(array('http://www.google.com/m8/feeds'));
  $client-&gt;setRedirectUri('http://localhost/yac/proxy/contacts.php');
  $client-&gt;setAccessType('online');
  
  if(isset($_GET['code']))
  {
  echo "here";
      $client-&gt;authenticate();
      $_SESSION['token'] = $client-&gt;getAccessToken();
      header('location:http://localhost/yac/proxy/contacts.php');
  }
  
  if(!isset($_SESSION['token']))
  {
      $url = $client-&gt;createAuthUrl();
  
      ?&gt;
      &lt;a href="&lt;?=$url;?&gt;"&gt; List google contacts&lt;/a&gt;
      &lt;?php
  }
  else
  {
      $client-&gt;setAccessToken($_SESSION['token']);
  }
  
  ?&gt;
  </code></pre>
  
  <p>As I said, I tried the solutions proposed in the second tutorial but in vain.</p>
  
  <p>Does anyone know how to fix this problem ?</p>
  
  <p>Thanks.</p>