我尝试将在本地计算机上运行的PHP脚本连接到Swisscom S3 Storage Space。该脚本使用亚马逊的S3服务运行良好。
我这样连接:
static::$s3->client = \Aws\S3\S3Client::factory(array(
'credentials' => array(
'key' => ['s3_aws_key'],
'secret' => ['s3_aws_secret'],
),
'region' => ['s3_aws_region'],
'endpoint' => ['s3_aws_endpoint'],
'version' => "2006-03-01",
'signature' => "v2"
));
我得到以下例外情况:
在OSX 10.11.5,PHP 5.5.34和libcurl / 7.43.0
上"type": "Aws\\S3\\Exception\\S3Exception",
"code": 0,
"message": "Error executing "PutObject" on "https://ds31s3.swisscom.com/***/***/***.jpg"; AWS HTTP error: cURL error 56: SSLRead() return error -9806 (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)"
在Amazon EC2实例上,例外情况有所不同:
"type": "Aws\\S3\\Exception\\S3Exception",
"code": 0,
"message": "Error executing "PutObject" on "https://ds31s3.swisscom.com/***/***/***.jpg"; AWS HTTP error: cURL error 56: TCP connection reset by peer (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)"
我应该向哪个方向暗示?正如我所说,使用亚马逊运行脚本非常完美。
答案 0 :(得分:0)
好的 - 发现:
将SDK从3.1.X降级到2.8.X解决了这个问题。