AWS代码适用于PHP5.5.6,但不适用于PHP5.3.1

AWS代码适用于PHP5.5.6,但不适用于PHP5.3.1,php,amazon-web-services,Php,Amazon Web Services,下面的代码在PHP版本5.5.6中工作,而不是在PHP 5.3.1中工作。 运行此文件时,将显示一个空页面 use Aws\S3\S3Client; use Aws\S3\Exception\S3Exception; $bucket = 'report160316'; $keyname = 'xxxxxxxxxxxxxxx'; $secret = 'xxxxxxxxxxxxxxxxxxxx'; // Instantiate the client. $s3 = S3Client::factory

下面的代码在PHP版本5.5.6中工作,而不是在PHP 5.3.1中工作。 运行此文件时,将显示一个空页面

use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;

$bucket = 'report160316';
$keyname = 'xxxxxxxxxxxxxxx';
$secret = 'xxxxxxxxxxxxxxxxxxxx';
// Instantiate the client.
$s3 = S3Client::factory([
    'key' =>$keyname,
    'secret' =>$secret,
]);
从(我的)重点:

最低要求
  • PHP5.3.3+使用cURL、JSON和XML扩展编译
  • 使用OpenSSL和zlib编译的最新版本的cURL 7.16.2+

因此,您的PHP版本根本无法满足最低要求。

对于PHP/5.3,您需要使用array()而不是[]

i、 e


谢谢。我有另一个服务器PHP5.3.3,但是cURL版本是7.15.5。AWS会不会工作。。????
$s3 = S3Client::factory(array(
   'key' => $keyname,
   'secret' => $secret,
));