I'm trying to use Zen_Service_Amazon api but I have a problem.
When I try to run this code on localhost:


require_once 'Amazon.php';

//i've gor api key and secret key from my aws account

$amazon = new Zend_Service_Amazon($api_key, 'US', $secret_key);

$results = $amazon->itemSearch(array(
'SearchIndex' => 'Books',
'Keywords' => 'php',
'AssociateTag' => 'YOUR_ASSOC_TAG_HERE',

foreach ($results as $result) {
    echo $result->Title . '<br />';


it shows me 2 warnings:

Warning: gzinflate() [function.gzinflate]: data error in C:\xampp\php\ZendFramework\library\Zend\Http\Response.php on line 612

Warning: DOMDocument::loadXML() [domdocument.loadxml]: Empty string supplied as input in C:\xampp\htdocs\zend_amazon\Amazon.php on line 130

I read the documentation and tutorials about zend amazon service but I didn't find response to my problem.

Is there anyone who know what could be a problem and how to slove it?

Thanks in advance,


i dont know the amazon api but this doesn't look right to me

'AssociateTag' => 'YOUR_ASSOC_TAG_HERE',

looks like you need to suply a AssociateTag

Thanks for the answer.
I read somewhere that associate tag parameter is optional and I tried
without this parameter and it shows me the same error.
How can I get this parameter?