Laravel 5亚马逊AWS S3错误:客户端错误:403 RequestTimeTooSkewed [英] Laravel 5 Amazon AWS S3 Error: Client error: 403 RequestTimeTooSkewed

查看:927
本文介绍了Laravel 5亚马逊AWS S3错误:客户端错误:403 RequestTimeTooSkewed的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过laravel应用程序上传文件到S3存储

I'm trying to upload files to an S3 bucket via a laravel app

我收到以下错误:

S3Exception在WrappedHttpHandler.php行152:错误执行   在 https://s3-ap-southeast-1.amazonaws.com/

S3Exception in WrappedHttpHandler.php line 152: Error executing "PutObject" on "https://s3-ap-southeast-1.amazonaws.com/

AWS HTTP错误:客户端错误:403 RequestTimeTooSkewed(客户端):在   请求时间和当前时间之间的差过大

AWS HTTP error: Client error: 403 RequestTimeTooSkewed (client): The difference between the request time and the current time is too large

我已经做了一些研究,很多人说我在我的机器的时间不同步。我怕搞乱,因为宅基地的我怕打破东西的。更改我的应用程序时区?真的不知道。

I've done some research and many say that my my machine's time is not synced. I'm afraid of messing with homestead because im afraid of breaking something. Do i change my app timezone? Really not sure.

请帮助,感谢您抽出宝贵的时间

Please help and thank you for taking the time

推荐答案

您将需要更新时钟的宅基地进行安装。您可以使用NTPD,以确保这样可以使你的时钟为最新系统,可以在重新启动从一个合理的时间遭受做到这一点。在虚拟机,这似乎是更为显著(但我不知道的细节原因)。

You will need to update the clock on your homestead installation. You can do this using ntpd to ensure that this keeps your clock up to date as systems can suffer from a reasonable amount of time during reboots. On VMs this seems to be even more significant (but I am not sure of the details why).

要获得NTPD设置和运行执行以下步骤,你的家园中;

To get ntpd setup and running do the following in your homestead box;

sudo apt-get install ntp

然后,你需要设置你的趋炎附势。运行以下;

Then you need to set your timeservers. Run the following;

sudo nano /etc/ntp.conf

然后确保文件中有如下内容;

Then make sure the file has the following contents;

server ntp.ubuntu.com
server pool.ntp.org

如果您保存这些更改,然后运行;

Once you've saved those changes then run;

sudo service ntpd restart

一旦你做到了这一点NTPD将让您的系统时钟正确的最小化漂移误差从S3回来的风险照顾。

Once you have done this ntpd will take care of keeping your system clock correct minimising the risk of a drift error coming back from S3.

最后,我想指出不要过分担心破坏你的家园环境,因为它是一个虚拟机。它的好处是,你可以很容易重建它,如果你得到了什么。

Finally I would note not to worry too much about breaking your homestead environment as it is a virtual machine. The beauty of which is you can very easily rebuild it if you get something wrong.

这篇关于Laravel 5亚马逊AWS S3错误:客户端错误:403 RequestTimeTooSkewed的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆