0

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!

2
  • As the default include_path includes the app's root, you shouldn't need to alter it before including google-api-php-client/src/Google/autoload.php Commented Mar 4, 2015 at 23:46
  • I agree in premise, but the documentation indicates you should add the set_path_include line. Also what would be the explanation as to what is causing the PHP warning? Commented Mar 5, 2015 at 7:24

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.