Google app engine for php use google api client

reference https://gaeforphp-blog.appspot.com/2013/08/06/using-the-google-apis-client-library-for-php-with-app-engine/

#google app engine for php can’t use curl but can use http_stream with stream_context_create() , change ioClass from Google_CurlIO to Google_HttpStreamIO

Follow these steps to get the client library up and running.

  1. Download the latest release package of the client.
  2. Extract the library from the archive and copy the google-api-php-client directory to your project root.
  3. Edit the file 
    google-api-php-client/src/config.php

    , and configure the client to use HTTP streams and memcache by making the following changes to the 

    $apiConfig
  4. // Which Authentication, Storage and HTTP IO classes to use.
    'authClass'    => 'Google_OAuth2',
    'ioClass'      => 'Google_HttpStreamIO',
    //'ioClass'      => 'Google_CurlIO',
    'cacheClass'   => 'Google_MemcacheCache',

    // We need to configure fake values for memcache to work
    'ioMemCacheCache_host' => 'does_not_matter',
    'ioMemCacheCache_port' => '37337',
  5. Test that the client is working correctly by following the Google Plus example on the client home page.

Related posts:

This entry was posted in Google API Oauth2.0, google app engine. Bookmark the permalink.