title: Google Drive API error in cron job
body: <p>I have a cron job in cpanel that connects to google drive to backup the website files and database regularly to google drive account. I simplified the file to spot the problem:</p>
  
  <pre><code>&lt;?php
  
  set_time_limit(0);
  
  require_once 'google-api-php-client/Google_Client.php';
  require_once 'google-api-php-client/contrib/Google_DriveService.php';
  
  $client = new Google_Client();
  $client&gt;setClientId('xxxx');
  $client-&gt;setClientSecret('xxxx');
  $service = new Google_DriveService($client);
  
  $accessToken = '{ "access_token" : "xxx", "token_type" : "Bearer", "expires_in" : 3600, 
  "refresh_token" : "1/xxx" }';
  $client-&gt;setAccessToken($accessToken);
  
  $files = $service-&gt;files-&gt;listFiles();
  
  print($files);
  
   ?&gt;
  </code></pre>
  
  <p>I authenticated and got the refresh token and the access token and put them in the variable <code>$accessToken</code>. The script works when run from browser but when i set it as a cron job I get the following errors:</p>
  
  <pre><code>[13-Jul-2013 13:41:02 Europe/Moscow] PHP Fatal error:  Uncaught exception 
  'Google_IOException' with message 'HTTP Error: (0) error setting certificate verify     
  locations:
  CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
  ' in /home/xxxxxx/backup/google-api-php-client/io/Google_CurlIO.php:128
  Stack trace:
  #0 /home/xxxxxx/backup/google-api-php-client/auth/Google_OAuth2.php(270):    
  Google_CurlIO-&gt;makeRequest(Object(Google_HttpRequest))
  #1 /home/xxxxxx/backup/google-api-php-client/auth/Google_OAuth2.php(248): 
  Google_OAuth2-&gt;refreshTokenRequest(Array)
  #2 /home/xxxxxx/backup/google-api-php-client/Google_Client.php(315): 
  Google_OAuth2-&gt;refreshToken('1/xxxxxx...')
  #3 /home/xxxxxx/backup/index.php(20): Google_Client-   
  &gt;refreshToken('1/xxxxxx...')
  #4 {main}
  thrown in /home/xxxxxx/backup/google-api-php-client/io/Google_CurlIO.php on line   
  128
  </code></pre>