【发布时间】:2014-09-15 22:22:04
【问题描述】:
我已经尝试修复此问题 5 个小时了。
这是我当前的 php 代码。
set_include_path("google-api-php-client-master/src/Google");
require_once 'Google/Client.php';
require_once 'Google/Service/YouTube.php';
目录结构如下:
+/test/
+google-api-php-client-master/
test.php
所以 php 文件与 google api 文件夹位于同一目录中。不幸的是,我总是收到错误:
Warning: require_once(Google/Client.php) [function.require-once]: failed to open stream: No such file or directory in /test/test.php on line 20
Fatal error: require_once() [function.require]: Failed opening required 'Google/Client.php' (include_path='google-api-php-client/src') in /test/test.php on line 20
我还设置了文件的权限。我真是一头雾水。
编辑:我随机尝试了一些东西,这个解决方案对我有用:
set_include_path("api/src/");
require_once 'Google/Client.php';
require_once 'Google/Service/YouTube.php';
【问题讨论】:
标签: php youtube-api include-path require-once