require_once(Google/Auth/AssertionCredentials.php):无法打开流:没有这样的文件或目录 [英] require_once(Google/Auth/AssertionCredentials.php): failed to open stream: No such file or directory

查看:92
本文介绍了require_once(Google/Auth/AssertionCredentials.php):无法打开流:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试做一个非常简单的事情:

I'm trying to do a very simple:

require_once 'vendor/google/src/Google/Client.php';
require_once 'vendor/google/src/Google/Service/Plus.php';

...我得到这个错误:

...and I get this error:

require_once(Google/Auth/AssertionCredentials.php): failed to open stream: No such file or directory

为什么?

我正在使用 https://github.com/google上可用的最新版本/google-api-php-client ,似乎在Client.php中,每个require_once都使用了错误的路径...还是没有?

I'm using the latest version available on https://github.com/google/google-api-php-client and seems that in Client.php each require_once uses a wrong path... or not?

任何帮助将不胜感激!

非常感谢,
尼科洛

Thanks a lot,
Niccolò

推荐答案

对于您的问题,您需要在php'include_path'中添加库的基本目录.

For your problem you need to add the base directory of the library in the php 'include_path'.

尝试将这行代码放在require_once之前

Try putting this line of code before the require_once

set_include_path( get_include_path() . PATH_SEPARATOR . 'vendor/google/src' );

这篇关于require_once(Google/Auth/AssertionCredentials.php):无法打开流:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆