title: Invalid parameter value for redirect_uri: Invalid scheme: &lt;http:
body: <p>Good Evening - I am using the following youtube tutorial named "Tutoriel PHP - Importer des contacts Google" to try and import google contacts 
  <a href="https://www.youtube.com/watch?v=ysNVe0TaVFs" rel="nofollow">https://www.youtube.com/watch?v=ysNVe0TaVFs</a></p>
  
  <p>When I click on the link to import google contacts, instead of asking for permission and getting the contacts and displaying them on screen, there is this problem -  I get the following error:</p>
  
  <p>Error: invalid_request</p>
  
  <p>Invalid parameter value for redirect_uri: Invalid scheme: &lt;<a href="http://chi.fis.com/mut_folder/index.php" rel="nofollow">http://chi.fis.com/mut_folder/index.php</a> </p>
  
  <p>Please tell me what to do in order to fix the error. Thank you.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;?php 
  error_reporting(E_ALL);
  ini_set("display_errors", 1);
  
  session_start(); ?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html class="no-js" lang="en"/&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;meta name="viewport" content="width=device-width" /&gt;
      &lt;title&gt;Google Contacts API&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;h2&gt;Google Contacts API v3.0&lt;/h2&gt;
  &lt;?php
  require_once 'lib/google-api-client/autoload.php';
  require 'lib/google-api-client/Config.php';
  require 'lib/google-api-client/Google_Client.php';
  
  $client_id = '&lt;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.bbbbbb.cccccccccccc.com&gt;';
  $client_secret = '&lt;jfjdkfj3334FdsfJJF9999JK&gt;';
  $redirect_uri = '&lt;http://ccccccccccccccccccc.com/rddddddddddd/index.php&gt;';
  
  $client = new Google_Client();
  $client -&gt; setApplicationName('contact');
  $client -&gt; setClientid($client_id);
  $client -&gt; setClientSecret($client_secret);
  $client -&gt; setScopes('https://www.google.com/m8/feeds');
  $client -&gt; setRedirectUri($redirect_uri);
  $client -&gt; setAccessType('online');
  
  if (isset($_GET['code'])) {
      $client-&gt;authenticate();
      $_SESSION['token'] = $client-&gt;getAccessToken();
      header('Location: ' . $redirect_uri);
  }
  
  if(!isset($_SESSION['token']))
  {
      $url = $client-&gt;createAuthUrl();
      echo '&lt;a href="' . $url . '"&gt;Import Google Contacts&lt;/a&gt;';
  }else{
          $client-&gt;setAccessToken($_SESSION['token']);
          $token = json_decode($_SESSION['token']);
          $token-&gt;access_token;
          $curl = curl_init("https://www.google.com/m8/feeds/contacts/default/full?alt=json&amp;max-results=50&amp;access_token=" . $token-&gt;access_token);
          curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
          curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
          curl_setopt($curl, CURLOPT_TIMEOUT, 10);
          $contacts_json = curl_exec($curl);
          curl_close($curl);
          $contacts = json_decode($contacts_json, true);
          $return = array();
          foreach($contacts['feed']['entry'] as $contact){
              $return[] = array(
              'name' =&gt; $contact['title']['$t'],
              'email' =&gt; isset($contact['gd$email'][0]['address']) ? $contact['gd$email'][0]['address'] : false,
              'phone' =&gt; isset($contact['gd$phoneNumber'][0]['$t']) ? $contact['gd$phoneNumber'][0]['$t'] :false,
              );
          }
          var_dump($return);
      }       
  ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>