2017-03-07 50 views
0

我試圖AWS DynamoDB連接到我的PHP腳本,當我通過XAMPP打開了腳本的瀏覽器中,我得到了以下錯誤:缺少必要的客戶端的配置選項:版本

Fatal error: Uncaught exception 'InvalidArgumentException` with message 'Missing required client configuration options: version: (string) A "version" configuration value is required. Specifying a version constraint ensures that your code will not be affected by a breaking change made to the service. For example, when using Amazon S3, you can lock your API version to "2006-03-01". Your build of the SDK has the following version(s) of "dynamodb": * "2012-08-10" * "2011-12-05" You may provide "latest" to the "version" configuration value to utilize the most recent available API version that your client's API provider can find. Note: Using 'latest' in a production application is not recommended. A list of available API versions can be found on each client's API documentation page: http://docs.aws.amazon.com/aws-sdk-php/v3/api/index.html . If you are unable to load a specific API version, then you may need to update your copy of the SDK.' in C:\Users\Lenovo\xampp\htdocs\public_html\zip\aws\Aws in C:\Users\Lenovo\xampp\htdocs\public_html\zip\aws\Aws\ClientResolver.php on line 364

這是來自ClientResolver.php的第364行代碼塊:

private function throwRequired(array $args) 
{ 
    $missing = []; 
    foreach ($this->argDefinitions as $k => $a) { 
     if (empty($a['required']) 
      || isset($a['default']) 
      || array_key_exists($k, $args) 
     ) { 
      continue; 
     } 
     $missing[] = $this->getArgMessage($k, $args, true); 
    $msg = "Missing required client configuration options: \n\n"; 
    $msg .= implode("\n\n", $missing); 
    throw new IAE($msg); // This is line 364 
} 

你能幫我解決這個問題嗎?我是PHP的整個主題的新手。

回答

2

Your build of the SDK has the following version(s) of "dynamodb": * "2012-08-10" * "2011-12-05" You may provide "latest" to the "version" configuration value to utilize the most recent available

你需要確定你的版本給客戶對象,例如:

$client = DynamoDbClient::factory(array(
    .... 
    'version' => '2012-08-10', 
)); 

您可以在這裏找到的版本http://docs.aws.amazon.com/aws-sdk-php/v3/api/index.html

名單
相關問題