我完全不熟悉php。我正在尝试构建一个系统将视频上传到YouTube并保留其网址。另一个Flash应用程序稍后将它们结合起来我正在清理目标,以便我可以放心,图书馆可以执行这些任务。从php访问YouTube服务
1)在默认通道 2)获得视频网址 3)上传下载视频进行离线观看
我发现这是由谷歌搜索使用PHP Zend库。但面临很多问题。我正在使用WAMP。我将zend库文件夹复制到“C:\ wamp \ www \ zend”并在此处更改了php.ini
; Windows:“\ path1; \ path2” include_path =“。; C:\ wamp \ www \ zend \ library; c:\ php \ includes”
感觉没有变化。所以我想用这段代码来测试这个库。
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
set_include_path('C:/wamp/library/zend/library' . PATH_SEPARATOR . get_include_path());
require_once 'zend/library/Zend/Gdata/YouTube.php';
require_once 'zend/library/Zend/Gdata/ClientLogin.php';
require_once 'zend/library/Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$authenticationURL= 'https://www.google.com/youtube/accounts/ClientLogin';
$httpClient =
Zend_Gdata_ClientLogin::getHttpClient(
$username = '[email protected]',
$password = '***',
$service = 'youtube',
$client = null,
$source = 'testphp',
$loginToken = null,
$loginCaptcha = null,
$authenticationURL);
$developerKey = 'AI3....w';
$applicationId = 'Student Collaborative Video System';
$clientId = 'Student Collaborative Video System';
$yt = new Zend_Gdata_YouTube($httpClient, $applicationId, $clientId, $developerKey);
$yt->setMajorProtocolVersion(2);
$videoFeed = $yt->getVideoFeed(Zend_Gdata_YouTube::VIDEO_URI);
printVideoFeed($videoFeed);
var_dump($videoFeed);
?>
错误我目前看到的是
1 0.0023 375392 {主}().. \ testphp.php:0
2 0.0086 560192 require_once(“C:\瓦帕\ WWW \ zend \ library \ Zend \ Gdata \ YouTube.php').. \ testphp.php:7
附加'使用error_reporting(E_ALL); ini_set('display_errors',1);''<?php'标签后面,可能是你有一个错误,但是它被压制了。另外,在你的set_include_path调用中,我认为'''zend \ library''需要''C:/ wamp/www/zend/library' – drew010
编辑后的代码在后面给出。误差是 调用栈 #\t \t时间内存\t \t功能位置 \t 0.0011 374264 \t {主}()\t .. \ testphp.php:0 \t 0.0045 559056 \t require_once(“C:\ wamp \ www \ zend \ library \ Zend \ Gdata \ YouTube.php')\t .. \ testphp.php:7 – shababhsiddique