缺少必需的客户端配置选项:版本

Missing required client configuration options: version

我试图将 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.

的整个话题都不熟悉

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