2012-04-18 74 views
0

我被迫使用phpquery :: getJson的體系結構的原因,因爲Curl php擴展給我一些問題(可能我無法正確設置它)。我希望直接使用getJson(我知道我也可以使用phpQuery :: ajax函數,並在手動解析結果後),所以如果有人比我更不專業,也可以使用此解決方案。phpquery getJson和Zend Json問題

你好我想利用這個:

phpQuery::getjson($url) 

或其它版本:

phpQuery::ajax(array(
    'type' => 'GET', 
    'url' => $url, 
    'data' => array('prova'=>'ciao'), 
    'success' => getJsCallback($doc), 
    'dataType' => 'json', 
)); 

但它說:

Warning: require_once(Zend/Json.php): failed to open stream: 
No such file or directory in /home/giuseppe/homeProj/phpQuery/phpQuery/phpQuery/Zend/Json/Decoder.php 

所以我手動添加從ZendFramework: 的Zend /Json.php Zend/Json/Expr.php

,這讓我:

Fatal error: Uncaught exception 'Zend_Json_Exception' with message 'Illegal Token' 

如果任何人有解決方案,並想與大家分享,他歡迎 感謝

回答

0

得益於藍色妖姬從GitHub回覆你應該添加zendframework到include路徑。

所以downlowad 1.1版本的Zend框架的,把它到達一個文件夾內的APACH(FE /無功/網絡/ Zf1_1 /),然後設置ZF frameowkr include路徑裏這樣說:

//replace /var/www/Zf1_1/library with your actualy ZF library path 
set_include_path(get_include_path() . PATH_SEPARATOR . '/home/giuseppe/homeProj/ZendFramework1/ZendFramework-1.11.11/library/'); 

如果它給你帶來的權限問題否認不要忘記把它從unix終端使用時它會放在裏面

$ chown www-data -R /var/www/Zf1_1/library