<tfoot id='Bncn1'></tfoot>
        <i id='Bncn1'><tr id='Bncn1'><dt id='Bncn1'><q id='Bncn1'><span id='Bncn1'><b id='Bncn1'><form id='Bncn1'><ins id='Bncn1'></ins><ul id='Bncn1'></ul><sub id='Bncn1'></sub></form><legend id='Bncn1'></legend><bdo id='Bncn1'><pre id='Bncn1'><center id='Bncn1'></center></pre></bdo></b><th id='Bncn1'></th></span></q></dt></tr></i><div id='Bncn1'><tfoot id='Bncn1'></tfoot><dl id='Bncn1'><fieldset id='Bncn1'></fieldset></dl></div>
      1. <small id='Bncn1'></small><noframes id='Bncn1'>

        <legend id='Bncn1'><style id='Bncn1'><dir id='Bncn1'><q id='Bncn1'></q></dir></style></legend>
          <bdo id='Bncn1'></bdo><ul id='Bncn1'></ul>
      2. 实现 Oauth2 登录,致命错误:找不到“Google_Service"类

        Implementing Oauth2 login, Fatal error: Class #39;Google_Service#39; not found(实现 Oauth2 登录,致命错误:找不到“Google_Service类)
          <tfoot id='JvEPR'></tfoot>

            • <bdo id='JvEPR'></bdo><ul id='JvEPR'></ul>

              <i id='JvEPR'><tr id='JvEPR'><dt id='JvEPR'><q id='JvEPR'><span id='JvEPR'><b id='JvEPR'><form id='JvEPR'><ins id='JvEPR'></ins><ul id='JvEPR'></ul><sub id='JvEPR'></sub></form><legend id='JvEPR'></legend><bdo id='JvEPR'><pre id='JvEPR'><center id='JvEPR'></center></pre></bdo></b><th id='JvEPR'></th></span></q></dt></tr></i><div id='JvEPR'><tfoot id='JvEPR'></tfoot><dl id='JvEPR'><fieldset id='JvEPR'></fieldset></dl></div>
                <tbody id='JvEPR'></tbody>
              <legend id='JvEPR'><style id='JvEPR'><dir id='JvEPR'><q id='JvEPR'></q></dir></style></legend>
              • <small id='JvEPR'></small><noframes id='JvEPR'>

                • 本文介绍了实现 Oauth2 登录,致命错误:找不到“Google_Service"类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在将我网站的登录系统从 LightOpenID 更新为 Google 的 Oauth 2.0.

                  I am updating my website's login system from LightOpenID to Google's Oauth 2.0.

                  当我需要 Client.php 和 Service/Oauth2.php 时出现错误

                  When I require the Client.php and the Service/Oauth2.php I get an error

                  致命错误:在第 32 行的/home/myname/repos/website_current/lib/google-api-php-client/src/Google/Service/Oauth2.php 中找不到Google_Service"类

                  Fatal error: Class 'Google_Service' not found in /home/myname/repos/website_current/lib/google-api-php-client/src/Google/Service/Oauth2.php on line 32

                  我使用的代码(来自我的 login.php 文件)看起来像这样

                  The code I am using (from my login.php file) looks like this

                  require_once(dirname($_SERVER['DOCUMENT_ROOT']).'/lib/autoload.php');
                  require('Google/Client.php');
                  require('Google/Service/Oauth2.php');
                  echo "exit";
                  exit();
                  

                  我在 PHP.ini(在/etc/php5/apache2/php.ini 中)添加了包含路径

                  I have added the include path in the 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"
                  

                  所以它似乎我的 Oauth2.php 文件看不到任何其他包含,包括类Google_Service",它是Service.php"中的一个文件夹.

                  So its seems my Oauth2.php file can't see any of the other includes including the class 'Google_Service' which is one folder up in 'Service.php'.

                  我的文件夹结构如下:

                  lib/
                  ... autoload.php
                  ... functions.php
                  ... google-api-php-client/
                      ... src/
                          ... Google/ (etc etc)
                  public_html/
                  ... login/
                      ...login.php
                  

                  我不知道为什么会发生这种情况.应该可以看到包含路径,并使用 phpinfo() 显示为包含路径;有人可以给我一些见解吗?

                  I have no idea why this is occuring. The include path should be seen, and shows up as an included path using phpinfo(); Can someone please give me some insight?

                  推荐答案

                  确保您在任何其他 Googlerequire_once"行BEFORE之前添加该行.

                  Make sure you add the line BEFORE any other Google "require_once" lines.

                  require_once 'google-api-php-client/autoload.php';
                  

                  我最后吃了它,它让我挠了 10 分钟.

                  I had it last and it had me scratching my head for a good 10 minutes.

                  这篇关于实现 Oauth2 登录,致命错误:找不到“Google_Service"类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                  <legend id='OL1QT'><style id='OL1QT'><dir id='OL1QT'><q id='OL1QT'></q></dir></style></legend>
                • <small id='OL1QT'></small><noframes id='OL1QT'>

                • <tfoot id='OL1QT'></tfoot>
                    <bdo id='OL1QT'></bdo><ul id='OL1QT'></ul>
                        <tbody id='OL1QT'></tbody>
                          1. <i id='OL1QT'><tr id='OL1QT'><dt id='OL1QT'><q id='OL1QT'><span id='OL1QT'><b id='OL1QT'><form id='OL1QT'><ins id='OL1QT'></ins><ul id='OL1QT'></ul><sub id='OL1QT'></sub></form><legend id='OL1QT'></legend><bdo id='OL1QT'><pre id='OL1QT'><center id='OL1QT'></center></pre></bdo></b><th id='OL1QT'></th></span></q></dt></tr></i><div id='OL1QT'><tfoot id='OL1QT'></tfoot><dl id='OL1QT'><fieldset id='OL1QT'></fieldset></dl></div>