douzi1117 2016-02-20 05:09
浏览 46

Google api php客户端 - 加载控制器页面时出错

I have used example from this site.

I have just added the credentials and the line:

require_once APPPATH . "libraries/google-api-php-client-master/src/Google/autoload.php";

in the controller.

It gives the following error :

Fatal error: Uncaught exception 'Exception' with message 'This library must be installed via composer or by downloading the full package. See the instructions at https://github.com/google/google-api-php-client#installation.' in /var/www/html/gauth/application/libraries/google-api-php-client-master/src/Google/autoload.php:14 Stack trace: #0 /var/www/html/gauth/application/controllers/user_authentication.php(15): require_once() #1 [internal function]: User_Authentication->index() #2 /var/www/html/gauth/system/core/CodeIgniter.php(360): call_user_func_array(Array, Array) #3 /var/www/html/gauth/index.php(202): require_once('/var/www/html/g...') #4 {main} thrown in /var/www/html/gauth/application/libraries/google-api-php-client-master/src/Google/autoload.php on line 14

Please help, I am doing this for the first time!

  • 写回答

1条回答 默认 最新

  • duangu3620 2016-02-20 06:19
    关注

    It is because your project missed the lib google-api-php-client,suggest you install it via composer.

    steps:

    • install composer (if you don't have)
    • add google-api-php-client lib to your project
    • rerun your code

    steps in command

    • php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php php -r "if (hash('SHA384', file_get_contents('composer-setup.php')) === 'fd26ce67e3b237fffd5e5544b45b0d92c41a4afe3e3f778e942e43ce6be197b9cdc7c251dcde6e2a52297ea269370680') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); }" php composer-setup.php php -r "unlink('composer-setup.php');"

    • composer require google/apiclient:^2.0.0@RC

    reference

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题