New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error: Class 'Google_Client' not found #1214
Comments
Hey @simonericci |
Whoops, /src folder missing... thanks @bshaffer |
Class 'vendor\Google\src\Google\Google_Client' not found |
I have the same problem, but havent find a solution yet |
Any help |
Did somebody find out a solution finally? |
No description provided. |
Any solution ? |
@induraniv @Wakodebe @garciacarmonaam @luispinonferrer-capgemini The error 'Fatal error: Class 'Google_Client' not found' indicates that Client.php was not included/required explicitly or automatically. That is typically due to a line like include_once __DIR__ . '/../vendor/autoload.php'; not resolving to the correct location (in the package archive: vendor/autoload.php). The path of autoload is relative any file with this line so make sure to account for that if you paste this line into other files. |
check the file composer.json and add "vendor/google/apiclient/src/Google" in classmap array if not exist. and run
|
You should definitely not need to add an autoload directive to your |
Yeah, Definitely. |
@tusharzore1 I do not know why in your specific case the class Google_Client isn't found, but I can tell you with certainty the class mapping should not need to be added to the classmap array. |
I had the same issue and when checking the |
require_once('/vendor/google-api-php-client-2.4.0/src/Google/autoload.php'); $client = new Google_Client(); I have checked the file path by file_exists function and included both the autoload files but system is still returning error: Please help to fix this issue. |
Is there anyone who can help me to fix this issue? |
I had the same issue in laravel and solved it by importing the Google_Client :
|
install google/apiclient:
|
I had tried a customised solution for this situation, commented above. |
if you have "vendor/google/apiclient/src/Google" directory and still you get this error try use command.
|
thank you very much this also solve the problem of mine... |
@DarshitAnjaria Hola, me puedes decir por favor en que parte lo pusiste? |
Faced the same issue on Codeigniter, I was including autoload.php of require "\vendor\google\auth\autoload.php" this was causing the problem. |
This "vendor/google/apiclient/src/Google" directory is not present after i installed composer |
Save me! For more clearly, importing This also applies to any other Google classes, eg. |
I tried everything as you mentioned but still getting error!! |
Try this:
|
The base directories are now in If you use composer and include |
thx bro~ i'm ok~ |
Life saver. Thanks. This worked with CakePHP 4 |
Please update the composer.json
Inside the composer.json file under the extra update this
under the script section at the bottom add this line
After adding it, run the command
It will work. |
Api installed manually, not via Composer, downloaded from here (first zip): https://github.com/google/google-api-php-client/releases
I got this error, trying to instantiate the main class:
Fatal error: Class 'Google_Client' not found
require_once('./vendor/autoload.php'); putenv('GOOGLE_APPLICATION_CREDENTIALS=./mycredentials.json'); $client = new Google_Client(); $client->useApplicationDefaultCredentials(); $client->setScopes('https://www.googleapis.com/auth/fusiontables'); $service = new Google_Service_Fusiontables($client);
This is the source code I can see in /vendor/autoload.php
`<?php
// autoload.php @generated by Composer
require_once DIR . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit9c18b0e2f8ac75b5fbc347bb34dca41d::getLoader();`
Any hint?
The text was updated successfully, but these errors were encountered: