ZendService\Amazon\S3 尝试实例化对象时出现错误 500

ZendService\Amazon\S3 error 500 trying to instantiate object

我正在尝试通过我的 zend 框架 3 应用程序在 S3 中列出我的存储桶。

我已经通过 composer 安装了 ZendService\Amazon\S3 并且正在学习本教程:

https://framework.zend.com/manual/2.4/en/modules/zendservice.amazon.s3.html

但是当我访问我的函数时出现错误 500。

我的代码是这样的:

public function uploadFotoAction() {
    // $awsAccessKey value here
    // $awsSecretKey value here

    $s3 = new ZendService\Amazon\S3( $awsAccessKey, $awsSecretKey );

    return new JsonModel([
        'sucesso' => true
    ]);
}

我需要配置更多东西吗?

所以,有两个问题:

而不是

ZendService\Amazon\S3( $awsAccessKey, $awsSecretKey );

必须使用

\ZendService\Amazon\S3\S3( $awsAccessKey, $awsSecretKey );

另一个问题是我的凭据没有列出存储桶的权限,所以当我尝试这样做时出现错误 500