Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

IsaacBen's avatar

Upload back ups to S3

I'm using the Laravel back up package https://github.com/spatie/laravel-backup and trying to send it to s3, but I get these errors. Do you know where the problem is?

Error:

 [Aws\S3\Exception\S3Exception]
 Error executing "PutObject" on "https://s3.US Standard.amazonaws.com/bucket/backups/"; AWS HTTP error: cURL error 6:
  Could not resolve host: s3.US Standard.amazonaws.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

 [GuzzleHttp\Exception\ConnectException]
 cURL error 6: Could not resolve host: s3.US Standard.amazonaws.com (see http://curl.haxx.se/libcurl/c/libcurl-error
 s.html)

This is my policy:

{
    "Id": "Policy515561141",
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt1545454510847",
            "Action": [
                "s3:PutObject"
            ],
            "Effect": "Allow",
            "Resource": [
                "arn:aws:s3:::bucket/*",
                "arn:aws:s3:::bucket"
            ],
            "Principal": "*"
        }
    ]
}
0 likes
3 replies
christopher's avatar

mh .. for me it looks like it is the wrong url. "https://s3.US Standard.amazonaws.com" is a global aws url, not your bucket url. Theres also an emtpy space between US and Standard, so i think you put your backups to the wrong bucket url.

A bucket url would look like ( IAM User / bucket @ aws )

https //AKIAJ7UHZDA4YXXXXXXXX@s3.amazonaws.com

Make also sure to create an IAM User in your aws console for your bucket.

IsaacBen's avatar

@christopher Thanks for responding. Indeed I tried many regions, but it didn't work. Eventually I went to apple and bought me a mac to replace the horrible windows machine I had and now it works. Now though I'm using laravel 5.2 which the back up package doesn't support so I will have to do it by myself.

Please or to participate in this conversation.