Upload to s3 via PHP fails access denied
I found the problem thanks to this answer. I'm trying to set the ACL 'public-read'
, but haven't granted myself s3:PutObjectAcl
, just s3:PutObject
. Changing either fixes the problem.
Thanks anyway for the help.
Error when uploading file to S3: PutObject error
I found the cause in local development case. It is silly. It seems cURL of my mac and php cURL were different version. mac cURL is 7.54.0 and php using cURL is 7.65.3
So i uninstalled last cURL version
brew uninstall curl-openssl --ignore-dependencies
and restarted the php
brew services restart php
Now Its all working.
In case where I mentioned beanstalk was not working too, it was silly ignorant mistake about something else error in code. This one really was my blunder because if I paid more close attention in this case then I could have saved my time a lot.
Can't Upload File to Amazon S3
Try using ap-southeast-1
as the region instead of s3-ap-southest-1
.
Aws PHP Sdk 3: S3::putObject(): AWS HTTP error: cURL error 6: Couldn't resolve host 's3.Ireland.amazonaws.com'
There is no such AWS region as "Ireland". The valid regions for S3 are listed on Amazon's web site; the one you're probably trying to use here is EU (Ireland), which would be represented in a region parameter as eu-west-1
.
Related Topics
Codeigniter Redirect -- the Uri You Submitted Has Disallowed Characters
Simple PHP Mail Function Not Working on Amazon Server Ec2
Laravel Change Connection Dynamically
PHP MySQL SQL Parser (Insert and Update)
Get Number of Weekdays in a Given Month
Do I Have to Use MySQL_Real_Escape_String If I Bind Parameters
PHP Eval That Evaluates HTML & PHP
Is a Blob Converted Using the Current/Default Charset in MySQL
Jquery UI Saving Sortable List
Convert Hex to Ascii Characters
Best Way to Check a Empty Array
Table Name as Parameter Using Pdo/MySQL Prepared Statement
Create Unique Poll/Vote/Survey in PHP