尝试createBucket或createObject
时我收到以下回复:
object(Zend_Http_Response)#13 (5) {
["version":protected] => string(3) "1.1"
["code":protected] => int(403)
["message":protected] => string(9) "Forbidden"
["headers":protected] => array(6) {
["X-amz-request-id"] => string(16) "XXX"
["X-amz-id-2"] => string(64) "XXX"
["Content-type"] => string(15) "application/xml"
["Transfer-encoding"] => string(7) "chunked"
["Date"] => string(29) "Mon, 09 Jul 2012 21:45:45 GMT"
["Server"] => string(8) "AmazonS3"
}
["body":protected] => string(875) "35f
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><StringToSignBytes>50 55 54 0a 0a 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78 2d 77 77 77 2d 66 6f 72 6d 2d 75 72 6c 65 6e 63 6f 64 65 64 0a 4d 6f 6e 2c 20 30 39 20 4a 75 6c 20 32 30 31 32 20 32 31 3a 34 35 3a 34 35 20 2b 30 30 30 30 0a 2f 65 64 75 70 72 6f 74 6f 6e 64 62 2f</StringToSignBytes><RequestId>XXXX</RequestId><HostId>XXX</HostId><SignatureProvided>XXX</SignatureProvided><StringToSign>PUT
application/x-www-form-urlencoded
Mon, 09 Jul 2012 21:45:45 +0000
/eduprotondb/</StringToSign><AWSAccessKeyId>XXXAWSAccessKeyId></Error>
0
"
}
我不确定我做错了什么因为getBuckets,deleteBuckets工作得很好?
$s3 = new Zend_Service_Amazon_S3($access_key, $secret_key, $region);
$s3->createBucket('eduprotondb');
答案 0 :(得分:0)
将您正在使用的亚马逊S3区域添加为函数中的“位置”参数。我只是遇到了同样的问题,就解决了!
$s3->createBucket($bucket, "us-west-1");