【发布时间】:2015-05-14 15:51:39
【问题描述】:
我收到以下错误
Fatal error: Uncaught exception 'Aws\Common\Exception\InvalidArgumentException' with message 'Unable to utilize caching with the specified options' in vendor/aws/aws-sdk-php/src/Aws/Common/Credentials/Credentials.php:305 Stack trace:
#0 vendor/aws/aws-sdk-php/src/Aws/Common/Credentials/Credentials.php(113): Aws\Common\Credentials\Credentials::createCache(Object(Aws\Common\Credentials\RefreshableInstanceProfileCredentials), Object(Illuminate\Cache\ApcStore), 'credentials_214...')
#1 vendor/aws/aws-sdk-php/src/Aws/Common/Client/ClientBuilder.php(431): Aws\Common\Credentials\Credentials::factory(Object(Guzzle\Common\Collection))
#2 vendor/aws/aws-sdk-php/src/Aws/Common/Client/ClientBuilder.php(227): Aws\Common\Client\ClientBuilder->getCredent in vendor/aws/aws-sdk-php/src/Aws/Common/Credentials/Credentials.php on line 305
使用以下代码
use Aws\Kms\Exception\KmsException,
Aws\Kms\KmsClient;
....
public function __construct($region = 'us-east-1')
{
$this->cacheAdapter = New Illuminate\Cache\ApcStore(New Illuminate\Cache\ApcWrapper());
$this->region = $region;
$this->kms = KmsClient::factory([
'credentials.cache' => $this->cacheAdapter,
'region' => $this->region,
]);
}
我认为这需要实现Guzzle CacheAdaperInterface,但不确定该怎么做?
【问题讨论】:
标签: php amazon-web-services interface