我正在使用amazon api上传我的内容 这是我的代码
set_time_limit(0);
require 'aws-autoloader.php';
use Aws\S3\S3Client;
// Instantiate the S3 client with your AWS credentials
$s3 = S3Client::factory(array(
'key' => '**** Key ******',
'secret' => '**** Secret Key *******'
));
$commands = array();
$commands[] = $s3->getCommand('PutObject', array(
'Bucket' => 'application-data',
'Key' => 'test.txt',
'Body' => fopen('test.txt', 'r'),
));
$s3->execute($commands);
foreach ($commands as $command) {
$result = $command->getResult();
echo "<pre>";
print_r($result);
}
但我收到了这个错误
Fatal error: Uncaught exception 'Guzzle\Service\Exception\CommandTransferException' with message 'Errors during multi transfer (Guzzle\Http\Exception\CurlException) .\Guzzle\Http\Curl\CurlMulti.php line 338 [curl] 28: Operation timed out after 150042 milliseconds with 0 out of 0 bytes received [url] https://test-data.s3.amazonaws.com/test.txt #0 .\Guzzle\Http\Curl\CurlMulti.php(279): Guzzle\Http\Curl\CurlMulti->isCurlException(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Curl\CurlHandle), Array) #1 .\Guzzle\Http\Curl\CurlMulti.php(244): Guzzle\Http\Curl\CurlMulti->processResponse(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Curl\CurlHandle), Array) #2 .\Guzzle\Http\Curl\CurlMulti.php(227): Guzzle\Http\Curl\CurlMulti->processMessages() #3 .\Guzzle\Http\Curl\CurlMulti.php(211): Guzzle\Http\Curl\CurlMulti->executeHandles() #4 .\Guzzle\Http\Curl\CurlMulti.php(105): Guzzle\Http\Curl\CurlMulti->perform() #5 .\Guzzle\Http\Curl\CurlMultiProxy in