amazon-s3-php-class icon indicating copy to clipboard operation
amazon-s3-php-class copied to clipboard

AuthorizationHeaderMalformed: the region 'us-east-1' is wrong; expecting 'ap-northeast-1'

Open CuteDeng opened this issue 5 years ago • 3 comments

get PHP Warning when S3::PutObject(), " AuthorizationHeaderMalformed: the region 'us-east-1' is wrong; expecting 'ap-northeast-1'"

CuteDeng avatar Dec 12 '19 09:12 CuteDeng

me too getting the same error but if you create the right bucket it works.

maharzan avatar Dec 26 '19 06:12 maharzan

Have you tried using setRegion->('ap-northeast-1') ?

phpandrew avatar Feb 18 '20 19:02 phpandrew

@lylesback2's answer is almost exactly right (just a small typo) but it totally pointed me in the right direction and now my uploads are working as expected.

$awsRegion = 'us-east-2';
$s3 = new S3($awsID, $awsSK);
$s3->setRegion($awsRegion);

indextwo avatar May 22 '20 17:05 indextwo