SignatureDoesNotMatch - Amazon S3 API SignatureDoesNotMatch - Amazon S3 API php php

SignatureDoesNotMatch - Amazon S3 API


When you sign up for Amazon, you can create yourself a key pair (Amazon calls those access key ID and secret access key).

Those two are used to sign requests to Amazon's webservices. Amazon re-calculates the signature and compares if it matches the one that was contained in your request. That way the secret access key never needs to be transmitted over the network.

If you get "Signature does not match", it's highly likely you used a wrong secret access key. Can you double-check access key and secret access key to make sure they're correct?


Personally I received this error because of the characters that were in my meta data.

The problematic character was the "–" chracter which is "\u2013" in unicode and different to "-".

$result = $s3->putObject(array(    'Bucket'       => $bucket,    'Key'          => $keyname,    'Metadata' => [        'name' => 'Terminology – Blah'    ]));

A note from the documentation http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#UserMetadata...

Amazon S3 stores user-defined metadata in lowercase. Each name, value pair must conform to US-ASCII when using REST and UTF-8 when using SOAP or browser-based uploads via POST.


I had this error with putObject() when specifying a Key starting with slash character (/) - after removing the slash it worked fine.