I am updating my site login from LightOpenID to Google Oauth 2.0.
When I need Client.php and Service / Oauth2.php, I get an error
Fatal error: class "Google_Service" was not found in / home / myname / repos / website _current / lib / google-api-php-client / src / Google / Service / Oauth2.php on line 32
The code I'm using (from my login.php file) is as follows:
require_once(dirname($_SERVER['DOCUMENT_ROOT']).'/lib/autoload.php'); require('Google/Client.php'); require('Google/Service/Oauth2.php'); echo "exit"; exit();
I added the include path in PHP.ini (in / etc / php5 / apache2 / php.ini) as
include_path = ".:/usr/local/lib/php:/home/myname/repos/website_current/lib/google-api-php-client/src"
So, it seems that my Oauth2.php file cannot see that any of the others includes the class "Google_Service", which is one folder in "Service.php".
My folder structure is as follows:
lib/ ... autoload.php ... functions.php ... google-api-php-client/ ... src/ ... Google/ (etc etc) public_html/ ... login/ ...login.php
I have no idea why this is happening. The include path should be seen and displayed as the included path using phpinfo (); Can someone please give me some idea?
source share