3

I'm trying to upload some files to S3 using Laravel and it's Filesystem api.

I'm getting the following error:

S3Exception in WrappedHttpHandler.php line 159:
Error executing "PutObject" on "https://s3..amazonaws.com/example-bucket/433922_1448096894943.png"; AWS HTTP error: cURL error 6: Could not resolve host: s3.global.amazonaws.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

here are my settings in the /config/filesystems.php file

    's3' => [
        'driver' => 's3',
        'key'    => 'apiKey',
        'secret' => 'secretApiKey',
        'region' => 'global',
        'bucket' => 'example-bucket',
    ], 

as noted in the error, the filesystem api can't resolve the following domain name

s3.global.amazonaws.com

the "global" part in here stands for the region but as far I understand S3 no longer requires a region.

while I think that the actual domain name should like this

example-bucket.s3.amazonaws.com/

here is the code I am using to invoke the filesystem api

Storage::disk('s3')->put('new-name.png', file_get_contents( 'path/to/file'))
3
  • s3.global.amazonaws.com does exist and resolves to an IP. There's a chance that there're no DNS servers listed on your server to resolve domain names Commented Nov 21, 2015 at 11:03
  • I just tried resolving s3.global.amazonaws.com on both my personal laptop and my server and it didn't resolve : (. I've also tried s3.us-east.amazonaws.com, which I think is a valid region, but that didn't work either Commented Nov 22, 2015 at 6:50
  • Just tried s3.us-east-1.amazonaws.com and that did resolve : ) Commented Nov 22, 2015 at 13:40

1 Answer 1

1

Had to set up the correct S3 region, which in my case was: eu-west-1, and it all started working.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.