こんなエラーが出てZend_Http_Clientでデータが取得できない場合
Warning: gzuncompress(): data error in Zend/Http/Response.php on line 601
Zend/Http/Response.php の 601行あたりをこんな風に修正する
/**
* Decode a zlib deflated message (when Content-encoding = deflate)
*
* Currently requires PHP with zlib support
*
* @param string $body
* @return string
*/
public static function decodeDeflate($body)
{
if (! function_exists(‘gzuncompress’)) {
require_once ‘Zend/Http/Exception.php’;
throw new Zend_Http_Exception(‘Unable to decode deflated response ‘ .
‘body: perhaps the zlib extension is not loaded?’);
}
//return gzuncompress($body);
// ↑をコメントにしてここから下の部分を書き加える
$result = gzinflate($body);
if($result){
return $result;
}else{
return gzuncompress($body);
}
}
これでOK