title: Google Calendar API v3 cant add event php
body: <p>hey cant seem to create an event with this code,</p>
  
  <pre><code>  &lt;?php
  require_once 'google-api-php-client/src/apiClient.php'
  require_once 'google-api-php-client/src/contrib/apiCalendarService.php';
  session_start();
  $client = new apiClient();
  $client-&gt;setApplicationName("Cal");
  $client-&gt;setClientId('');
  $client-&gt;setClientSecret('');
  //$client-&gt;setRedirectUri('http://localhost:8080/createEvent.php');
  $client-&gt;setRedirectUri('http://localhost:8080/eventNew.php');
  //http://localhost:8080/oauth2callback');
  $client-&gt;setDeveloperKey('');
  $cal = new apiCalendarService($client);
  
  if (isset($_GET['logout'])) {
      unset($_SESSION['token']);
  }
  
  if (isset($_GET['code'])) {
      $client-&gt;authenticate();
      $_SESSION['token'] = $client-&gt;getAccessToken();
      header('Location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);
  }
  
  if (isset($_SESSION['token'])) {
      $client-&gt;setAccessToken($_SESSION['token']);
  }
  
  $authUrl = $client-&gt;createAuthUrl();
  
  if (!$client-&gt;getAccessToken()) {
  
  $event = new Event();
  $event-&gt;setSummary("test title");
  $event-&gt;setLocation("test location");
  $start = new EventDateTime();
  $start-&gt;setDateTime('04-03-2012 09:25:00:000 -05:00');
  $event-&gt;setStart($start);
  $end = new EventDateTime();
  $end-&gt;setDateTime('04-03-2012 10:25:00:000 -05:00');
  $event-&gt;setEnd($end);
  //$attendee1 = new EventAttendee();
  //$attendee1-&gt;setEmail('email@email.com');
  //$attendees = array($attendee1);
  //$event-&gt;attendees = $attendees;
  $createdEvent = $cal-&gt;events-&gt;insert('primary', $event);
  
  echo $createdEvent-&gt;getId();
  
  $_SESSION['token'] = $client-&gt;getAccessToken();
  }
  ?&gt;
  </code></pre>
  
  <p>Keep getting this error message:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception 'apiIOException' with message 'HTTP Error: (0) SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed' in C:\Program Files\EasyPHP-5.3.9\www\google-api-php-client\src\io\apiCurlIO.php:119 Stack trace: #0 C:\Program Files\EasyPHP-5.3.9\www\google-api-php-client\src\io\apiCurlIO.php(56): apiCurlIO->makeRequest(Object(apiHttpRequest)) #1 C:\Program Files\EasyPHP-5.3.9\www\google-api-php-client\src\io\apiREST.php(55): apiCurlIO->authenticatedRequest(Object(apiHttpRequest)) #2 C:\Program Files\EasyPHP-5.3.9\www\google-api-php-client\src\service\apiServiceResource.php(186): apiREST::execute(Object(apiServiceRequest)) #3 C:\Program Files\EasyPHP-5.3.9\www\google-api-php-client\src\contrib\apiCalendarService.php(493): apiServiceResource->__call('insert', Array) #4 C:\Program Files\EasyPHP-5.3.9\www\eventNew.php(47): EventsServiceResource->insert('primary', Object(Event)) #5 {main} thrown in C:\Program Files\EasyPHP-5.3.9\www\google-api-php-client\src\io\apiCurlIO.php on line 119</p>
  </blockquote>