0
Я следующий кодGetSessionToken команда не найдена в AWS SDK
<?php
require '../aws/aws-autoloader.php';
use Aws\Sts\StsClient;
use Aws\S3\S3Client;
$sts = S3Client::factory(array(
'key' => 'key',
'secret' => 'key',
));
$result = $sts->getSessionToken();
$credentials = $result->get('Credentials');
print_r($credentials);
?>
Однако, это приводит к этой ошибке:
Uncaught exception 'Guzzle\Common\Exception\InvalidArgumentException' with message 'Command was not found matching GetSessionToken' in /home/site/public_html/dev/testAWS/core/aws/Guzzle/Service/Client.php:87 Stack trace: #0 /home/site/public_html/dev/testAWS/core/aws/Guzzle/Service/Client.php(76): Guzzle\Service\Client->getCommand('GetSessionToken', Array) #1 /home/site/public_html/dev/testAWS/core/aws/Aws/Common/Client/AbstractClient.php(105): Guzzle\Service\Client->__call('GetSessionToken', Array) #2 /home/site/public_html/dev/testAWS/core/ajax/test2.php(13): Aws\Common\Client\AbstractClient->__call('getSessionToken', Array) #3 /home/site/public_html/dev/testAWS/core/ajax/test2.php(13): Aws\S3\S3Client->getSessionToken() #4 {main} thrown in /home/site/public_html/dev/testAWS/core/aws/Guzzle/Service/Client.php on line 87
Проблема с этой линии:
$result = $sts->getSessionToken();
Я слежу за этим гидом: http://docs.aws.amazon.com/AmazonS3/latest/dev/AuthUsingTempSessionTokenPHP.html
Я не вижу причины возникновения ошибки. Есть ли причина для этого или способ исправить это?