While working on my local machine I have been trying to upload images (which uploads them immediately to the amazon server), but it was giving me a bug (RequestTimeTooSkewed Error using PHP S3 Class), I could figure out that it's a time zone issue and that S3 uses the current time zone to authenticate request, do I need to set up or change any configuration on the EC2 server to be able to upload images locally?
Sync your clock with an NTP time server. All modern OS's support this.
Wherever you're uploading from is the machine that needs to be synced.
Check your time synchronization on your ec2 instance. Due to the nature of virtual machines, the clock can skew over time. S3 does not allow requests that are more than a few minutes off.
Running code from a virtual machine, had to do sudo ntpdate ntp.ubuntu.com
to sync, and it worked.
Restarting the ntp service usually fixes this:
sudo service ntpd restart
See also: How to force a clock update using ntp?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With