I am updating my website\'s login system from LightOpenID to Google\'s Oauth 2.0.
When I require the Client.php and the Service/Oauth2.php I get an error
As of Nov 2016
require_once ... 'vendor/autoload.php';
Make sure you add the line BEFORE any other Google "require_once" lines.
require_once 'google-api-php-client/autoload.php';
I had it last and it had me scratching my head for a good 10 minutes.
The new way of doing this (circa early 2016) is
require_once("Google/autoload.php");
(Assuming you have already set your include path to have /path/to/google-api-php-client/src)
After following what Durandal had posted I tried it, but the new path for me is :
require_once 'google-api-php-client/src/Google/autoload.php';
Once I made this changed it worked. Thanks for the help.
While working with Google API integration
Fatal error: Class 'abc' not found
error comes when there is definitely something different between the library you have in composer.json above, and the library that is actually being auto-loaded.
had same problem just changed in my composer.json
{"require": {"google/apiclient": "1.0.*@beta"}}
to
{"require": {"google/apiclient": "2.0.*"}}
and then execute php composer.phar update (make sure you give right path for .phar file)
To this version https://github.com/google/google-api-php-client this is a posible solution
set_include_path("google-api-php-client/src/" . PATH_SEPARATOR . get_include_path());
//.....
require_once 'Google/Service.php';
//.....