Class “Google_Config” not found

前端 未结 6 592
太阳男子
太阳男子 2021-01-18 02:48

I\'m trying to implement Google\'s login API via the instructions here, but for some reason, when I try to run it, I always get:

Fatal error: Class \'

6条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-18 03:03

    google's autoloader doesn't work for me, it's either because of an old version of PHP or a conflict with a competing autoloader, I don't know.

    I have even tried manually including googles auto loader (which should be redundant as src/Google/Client.php already require_once's the autoload.php:

    require_once 'google-api-php-client/autoload.php'
    require_once 'google-api-php-client/src/Google/Client.php'
    

    Google_Config is never found...

    ultimatly the only solution is the solution as described in https://stackoverflow.com/a/26985116/3338098 i.e.

    set_include_path(get_include_path() . PATH_SEPARATOR . '/path/to/google-api-php-client/src');
    require_once 'Google/Client.php'
    

提交回复
热议问题