tristansokol
tristansokol

Reputation: 4261

trouble including Google APIs client library for PHP on Google App Engine

I am attempting to use the Google PHP library on App Engine, but am having trouble getting the include paths correct.

From the instructions here: https://developers.google.com/api-client-library/php/start/installation I am adding

set_include_path(get_include_path() . PATH_SEPARATOR . '/google-api-php-client/src');

to my code, but It does not seem to include the files properly. I get errors on include 'google-api-php-client/src/Google/autoload.php'; mainly

 PHP Warning:  include(): open_basedir restriction in effect.
 File(/base/data/home/apps/.../google-api-php-client/src/Google/autoload.php) is not within the allowed path(s)

I have tried more creative methods such as:

set_include_path(get_include_path() . PATH_SEPARATOR . realpath(dirname(__FILE__)).'/google-api-php-client/src');

but to no avail. Everything works fine on localhost, but presumably because it doesn't have the same include path restrictions.

any suggestions appreciated!

Upvotes: 0

Views: 348

Answers (1)

tristansokol
tristansokol

Reputation: 4261

The root of my error was that I was deploying with git commits (which wasn't tracking the google-api-php-client folder), not using the deploy script directly. When I deployed from the GoogleAppEngineLauncher, everything worked as expected.

Upvotes: 1

Related Questions