我正在将我的网站登录系统从LightOpenID更新为Google的Oauth 2.0.
原文链接:https://www.f2er.com/php/136791.html当我需要Client.PHP和Service / Oauth2.PHP时,我收到错误
@H_403_9@require_once(dirname($_SERVER['DOCUMENT_ROOT']).'/lib/autoload.PHP'); require('Google/Client.PHP'); require('Google/Service/Oauth2.PHP'); echo "exit"; exit();@H_301_10@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
我在PHP.ini中添加了include路径(在/etc/PHP5/apache2/PHP.ini中)
@H_403_9@include_path = ".:/usr/local/lib/PHP:/home/myname/repos/website_current/lib/google-api-PHP-client/src"@H_301_10@所以看来我的Oauth2.PHP文件看不到任何其他包含的类’Google_Service’,它是’Service.PHP’中的一个文件夹.
我的文件夹结构如下所示:
@H_403_9@lib/ ... autoload.PHP ... functions.PHP ... google-api-PHP-client/ ... src/ ... Google/ (etc etc) public_html/ ... login/ ...login.PHP@H_301_10@