2016-04-04 35 views
-1

Amazon ec2 üzerinde çalışıyorum. i hata aşağıdaki kod verilebilmesine entegre edildiğindeAmazon ec2 php ile eşleşmiyor

Fatal error: Uncaught exception 'Aws\Exception\CredentialsException' with message 'Error retrieving credentials from the instance profile metadata server. (cURL error 28: Connection timed out after 1996 milliseconds

İşte

require __DIR__ . '/aws.phar'; 

$client = Aws\S3\S3Client::factory([ 
'key' => '[********]', 
'secret' => '[************]', 
'region' => '[us-east-1]', // (e.g., us-east-1) 
'version' => 'latest' 
]); 

echo $client->listBuckets(); 
+1

Bunun gerçek anahtar ve sır değil umuyoruz. – apokryfos

+0

Cevabım sorununuzu çözdü mü? – helloV

cevap

0

Key ve Secret[ ve ] içermemelidir benim kodudur. Eğer deneyebilirsiniz:

'key' => '********', 
'secret' => '************', 
'region' => 'us-east-1', 

Passing credentials into a client factory method

// Instantiate the S3 client with your AWS credentials 
$s3Client = S3Client::factory(array(
    'credentials' => array(
     'key' => 'YOUR_AWS_ACCESS_KEY_ID', 
     'secret' => 'YOUR_AWS_SECRET_ACCESS_KEY', 
    ) 
));