- Newest
- Most votes
- Most comments
Hello.
Where are you running PHP?
If you're using a local PC, it's possible that the IAM user access key is not set correctly or that you're using the wrong user.
Also, it is possible that a bucket policy has already been set in S3 and that the "PutBucketPolicy" action is being denied by the bucket policy, so please check the S3 settings as well.
By the way, have you disabled all of the block public access settings described in the following document?
If these are not disabled, you will not be able to configure public access.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/configuring-block-public-access-bucket.html
There is also a way to use CloudFront to make objects in S3 public, so I recommend you check out the following documentation:
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago

I have to disabled all of the block public access settings (putPublicAccessBlock) and then do the putBucketPolicy Thanks