title: The request signature we calculated does not match AMAZON AWS PHP
body: <p>I have looked at most samples of code based on this issue on stack overflow but I still cant get the request to work. I keep getting this error:</p>
  
  <pre><code>&lt;Error&gt;&lt;Code&gt;SignatureDoesNotMatch&lt;/Code&gt;&lt;Message&gt;The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>$access_key = "ACCESS_KEY";
  $associateTag = "AOSSOCIATE_TAG";
  $secretkey = "SECRET_KEY";
  $keywords = "harry%20potter";
  $timestamp = gmdate("Y-m-d\TH:i:s\Z");
  $operation = "AWSECommerceService";
  
  function createSignature($operation,$timestamp,$secretkey){
      $the_string=$operation.$timestamp;  
      return base64_encode(hash_hmac("sha256",$the_string,$secretkey,true));
  }
  
  $signature = createSignature ($operation,$timestamp,$secretkey);
  
  $APIcall = 
  "http://ecs.amazonaws.com/onca/xml?".
  "AWSAccessKeyId=$access_key&amp;".
  "AssociateTag=$associateTag&amp;".
  "BrowseNode=1000&amp;".
  "ItemPage=1&amp;".
  "Keywords=$keywords&amp;".
  "Operation=ItemSearch&amp;".
  "ResponseGroup=Medium&amp;".
  "SearchIndex=Books&amp;".
  "Service=AWSECommerceService&amp;".
  "Timestamp=$timestamp&amp;".
  "Version=2011-08-01&amp;".
  "Signature=$signature";
  
  $response = simplexml_load_file($APIcall);
  </code></pre>
  
  <p>Can anyone help?</p>