所以我关注this,我试图运行他的第一个php示例。我收到以下错误:
PHP警告:require_once(
Zend/Http/Header/HeaderValue.php
):无法打开流:/opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Http/Client.php中没有这样的文件或目录45
我检查过,文件实际上不在那里。所以我从最小的1.12下载中添加了它。它然后说Zend/Xml/Security.php
不存在所以我添加它。
现在我收到以下错误:
PHP Notice: Undefined offset: 1 in /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/ClientLogin.php on line 150
PHP Stack trace:
PHP 1. {main}() /opt2/sites/gdataApi/test.php:0
PHP 2. Google_Spreadsheet->__construct() /opt2/sites/gdataApi/test.php:11
PHP 3. Google_Spreadsheet->login()/opt2/sites/gdataApi/Google_Spreadsheet.php:40
PHP 4. Zend_Gdata_ClientLogin::getHttpClient() /opt2/sites/gdataApi/Google_Spreadsheet.php:223
PHP Notice: Undefined variable: php_errormsg in /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php on line 834
PHP Stack trace:
PHP 1. {main}() /opt2/sites/gdataApi/test.php:0
PHP 2. Google_Spreadsheet->addRow() /opt2/sites/gdataApi/test.php:24
PHP 3. Google_Spreadsheet->getSpreadsheetId() /opt2/sites/gdataApi/Google_Spreadsheet.php:62
PHP 4. Zend_Gdata_Spreadsheets->getSpreadsheetFeed() /opt2/sites/gdataApi/Google_Spreadsheet.php:252
PHP 5. Zend_Gdata->getFeed() /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/Spreadsheets.php:150
PHP 6. Zend_Gdata_App->getFeed() /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata.php:162
PHP 7. Zend_Gdata_App->importUrl() /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php:213
PHP 8. Zend_Gdata_App::importString() /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php:792
PHP Fatal error: Uncaught exception 'Zend_Gdata_App_Exception' with message 'DOMDocument cannot parse XML: ' in /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php:833
Stack trace:
#0 /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php(792): Zend_Gdata_App::importString('', 'Zend_Gdata_Spre...', NULL, NULL)
#1 /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php(213): Zend_Gdata_App->importUrl('https://spreads...', 'Zend_Gdata_Spre...', NULL)
#2 /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata.php(162): Zend_Gdata_App->getFeed('https://spreads...', 'Zend_Gdata_Spre...')
#3 /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/Spreadsheets.php(150): Zend_Gdata->getFeed('https://spreads...', 'Zend_Gdata_Spre...')
#4 /opt2/sites/gdataApi/Google_Spreadsheet.php(252): Zend_Gdata_Spreadsheets->getSpreadsheetFeed()
#5 /opt2/sites/gdataApi/Google_Spreadsheet.php(62): Google_Spreadsheet->getSpreadsheetId('test spreadshee...')
#6 /opt2/sites/gdataApi/test.php(24): Google_Spreadsheet in /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php on line 833
我有一个谷歌电子表格,我想使用PHP以编程方式更新。你能告诉我这个剧本出了什么问题吗?好像这是一篇旧文章。我最近有哪些文章丢失吗?
答案 0 :(得分:3)
下载Zend框架最小版本。然后解压缩归档并将 / library / Zend / Http / Header 目录复制到GData的 / Zend / Http / 目录。