【发布时间】:2013-12-05 16:45:44
【问题描述】:
我是一名 PHP 新手,在 http://www.youtube.com/watch?v=LMhN6pCAZWo 试用 YouTube API 演示。
我有他说要下载的 google-api-php-client 和 yt-samples-php-master 目录
www.mysite.com/video/google-api-php-client 和 www.mysite.com/video/yt-samples-php-master
search.php 文件位于 yt-samples-php-master 中,我已复制视频并设置:
if ($_GET['q'] && $_GET['maxResults']) {
set_include_path("./google-api-php-client/src");
// Call set_include_path() as needed to point to your client library.
require_once 'Google_Client.php';
require_once 'contrib/Google_YouTubeService.php';
我可以很好地访问 www.mysite.com/videos/yt-samples-php-master/search.php 但是当我搜索时我收到消息:
警告:require_once(Google_Client.php) [function.require-once]:无法打开流:/home/myusername/mysite.com/videos/yt-samples-php-master/search 中没有这样的文件或目录.php 在第 17 行
致命错误:require_once() [function.require]:无法在 /home/myusername/mysite.com 中打开所需的 'Google_Client.php' (include_path='./google-api-php-client/src/') /videos/yt-samples-php-master/search.php 在第 17 行。
我注意到 Google 提供的文件有一个拼写错误 require_once 'contrib/Google_YoutubeService.php';
应该是require_once 'contrib/Google_YouTubeService.php';
但这似乎没有帮助。任何线索将不胜感激!
编辑:我还通过视频目录将 755 递归设置为子目录和文件
【问题讨论】:
-
您想从该视频中获取详细信息还是获取所有视频?
-
嗨。首先,我只想使用 search.php 上的搜索并返回视频。一旦我得到正确的包含位置,我肯定想尝试学习其他选项
标签: php youtube youtube-api