【发布时间】:2016-02-11 13:17:24
【问题描述】:
我正在尝试使用 AWS php SDK 将图像从 php 上传到 S3。但是,在 Netbeans 中,我在完全按照 API 中的示例使用代码时遇到错误。我究竟做错了什么 ?我在我的项目中使用 php 5.5,Netbeans 在这个项目中也配置了 php 5.5。根据 AWS 文档,我使用 Composer 安装了 SDK,没有任何问题。我现在要回家了,但今晚会尝试回复。
我收到语法错误,提示“意外标识符”。
// Include the SDK using the Composer autoloader
require 'vendor/autoload.php';
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;
// Instantiate the S3 client using your credential profile
$s3Client = S3Client::factory(array(
'profile' => 'default',
));
查看这些屏幕截图:
【问题讨论】:
-
您使用的 SDK 版本是什么。是 3 吗?
-
另外,你试过“composer dump-autoload”
-
老兄,2年过去了,我什至不再carr了。但是谢谢!!
-
:D :D 遇到了同样的问题。升级了 SDK 并且它工作了 ;)
标签: php amazon-web-services amazon-s3 netbeans-8