4

我正在尝试使用KNPLabs gaufrette 包将图像文件上传到 S3。调试来自 S3 的响应时出现以下错误:

The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

images.mynamespace.com.s3.amazonaws.com

我尝试将 base_url 参数设置为该端点,但仍然得到相同的错误。SO上还有其他问题建议设置我也尝试过的区域。

我要上传到的存储桶位于欧盟西部地区(爱尔兰)。无论我尝试什么配置,gaufrette 似乎仍在尝试使用 s3.amazonaws.com

如何正确配置 Gaufrette?

config.yml:

knp_gaufrette:
    adapters:
        image_storage:
            amazon_s3:
                amazon_s3_id: mynamespace_admin.amazon_s3
                bucket_name:  %amazon_s3_bucket_name%
                create:       false
                options:
                    create:     true
                    directory: 'dirname'
                    region:     eu-west-1


    filesystems:
        image_storage:
            adapter:    image_storage
            alias:      image_storage_filesystem
4

1 回答 1

7
I needed to set region to s3-eu-west-1.amazonaws.com

knp_gaufrette:
    adapters:
        image_storage:
            amazon_s3:
                amazon_s3_id: mynamespace_admin.amazon_s3
                bucket_name:  %amazon_s3_bucket_name%
                create:       false
                options:
                    create:     true
                    directory: 'dirname'
                    region:     s3-eu-west-1.amazonaws.com
于 2014-04-26T06:21:06.490 回答