Search code examples
phpamazon-s3file-uploadupload

SignatureDoesNotMatch - Amazon S3 API


I am using a PHP class for Amazon S3 and CloudFront - Link. But when I try to upload a file into a bucket, I get this error:

[SignatureDoesNotMatch] The request signature we calculated does not match the signature you provided. Check your key and signing method.

How to fix it?


Solution

  • 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?