您使用的是哪个版本的 SDK?
根据api v3 docs你可以使用这个:
$result = $client->updateDomainNameservers([/* ... */]);
$promise = $client->updateDomainNameserversAsync([/* ... */]);
这些是相关参数:
$result = $client->updateDomainNameservers([
'DomainName' => '<string>', // REQUIRED
'FIAuthKey' => '<string>',
'Nameservers' => [ // REQUIRED
[
'GlueIps' => ['<string>', ...],
'Name' => '<string>', // REQUIRED
],
// ...
],
]);
如果您使用的不是最新版本的 sdk,您可以使用composer 安装它:
php composer.phar require aws/aws-sdk-php
或使用任何installation methods here。
我真的认为你最好坚持使用 SDK,除非真的不可能(我认为这里不是这种情况,如果我错了,请纠正我)。
如果使用 composer 安装,您可以更新您的 composer.json 文件以包含:
{
"require": {
"aws/aws-sdk-php": "3.*"
}
}
然后运行composer update
如果您只想检查您正在使用的 sdk 版本,您可以运行 composer info(在该目录中):
> composer info
aws/aws-sdk-php 3.18.32 AWS SDK for PHP - Use Amazon Web Services in your PHP project
guzzlehttp/guzzle 6.2.1 Guzzle is a PHP HTTP client library
guzzlehttp/promises 1.2.0 Guzzle promises library
guzzlehttp/psr7 1.3.1 PSR-7 message implementation
mtdowling/jmespath.php 2.3.0 Declaratively specify how to extract elements from a JSON document
psr/http-message 1.0 Common interface for HTTP messages
或者检查composer.lock文件的内容。你应该有你正在使用的 sdk 的版本:
"packages": [
{
"name": "aws/aws-sdk-php",
"version": "3.18.32",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "84b9927ee116b30babf90a9fc723764672543e29"
},
确保使用最后一个。