這是我正在使用的簡化但準確的代碼。Amazon S3 - deleteObjects() - 「guzzle」錯誤?
$client = S3Client::factory(array('key'=>$ak,'secret'=>$sk));
foreach(range(1,10) as $i) $temp[] = array('Key'=>$i);
$result = $client->deleteObjects(array('Bucket'=>'bucket','Objects'=>$temp));
return $result;
一切正常,它刪除所請求的對象,但它會從phar文件中引發所有這些錯誤。正如您在下面看到的那樣在本地運行。
Fatal error: Uncaught exception 'Guzzle\Http\Exception\CurlException' with message '[curl] 56: Problem (2) in the Chunked-Encoded data [url] https://bucket.s3.amazonaws.com?delete=' in phar://C:/wamp/www/bucket/local/aws.phar/Aws/Common/Client/AbstractClient.php on line 285
Guzzle\Http\Exception\CurlException: [curl] 56: Problem (2) in the Chunked-Encoded data [url] https://bucket.s3.amazonaws.com?delete= in phar://C:/wamp/www/bucket/local/aws.phar/Guzzle/Http/Curl/CurlMulti.php on line 365
Aws\Common\Exception\TransferException: [curl] 56: Problem (2) in the Chunked-Encoded data [url] https://bucket.s3.amazonaws.com?delete= in phar://C:/wamp/www/bucket/local/aws.phar/Aws/Common/Client/AbstractClient.php on line 285
我目前有同樣的問題,當我嘗試從桶中獲取文件列表時,通常會顯示它。也許foareach()有問題?我正在用WAMP測試Windows 7。 – joshas
同樣在這裏,win7 x64和wamp。 – Mickey