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

QuatroQuatros's avatar

Amazon s3 upload error

I'm trying to upload an image to the s3 from amazon using Laravel 9. I hosted my code on heroku, and when I call the endpoint to upload it, it works, but when I call this same endpoint on my localhost, League\Flysystem gives an error "Unable to write file at location". I don't know what's going on, the code for both is the same and my bucket settings haven't changed.

0 likes
3 replies
Niush's avatar

May be a quick php artisan config:clear might help?

Or else it might be caused by invalid or missing ssl certificate. You might need to add this (or similar) depending on the setup you have. https://curl.se/docs/caextract.html

1 like
QuatroQuatros's avatar

@Niush I tried to configure the ssl certificate, but it didn't work either. I don't know if I configured it wrong or the code that is still wrong.

blueminded's avatar

Hello, devs.

I'm facing this same problem. I just upgraded my project to Laravel 9 and PHP 8.2 and I can't upload file to S3 anymore I'm getting ""Unable to write file at location". I'm test and prod server It's working fine with PHP 7.2 and Laravel 8, but I can't make it work on my local before the upgraded everything worked fine. this is driving me crazy. Any ideas how to solve it? Thanks in advance.

Please or to participate in this conversation.