你正在使用哪个版本的SDK?如果不使用最新版本的SDK
$result = $client->updateDomainNameservers([
'DomainName' => '<string>', // REQUIRED
'FIAuthKey' => '<string>',
'Nameservers' => [ // REQUIRED
[
'GlueIps' => ['<string>', ...],
'Name' => '<string>', // REQUIRED
],
// ...
],
]);
您可以使用composer
安装:
根据api v3 docs您可以使用此:
$result = $client->updateDomainNameservers([/* ... */]);
$promise = $client->updateDomainNameserversAsync([/* ... */]);
而这些相关参数:
php composer.phar require aws/aws-sdk-php
或使用任何installation methods here。
我真的认为它最适合你坚持使用SDK,除非真的不可能(我不认为这里是这种情况,纠正我,如果我错了)。
如果使用安装作曲家您可以更新您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"
},
确保您使用的是最后一个。
我有通过作曲家安装的SDK,我以为我有最新版本。我得到这个错误'未捕获的异常'Guzzle \ Common \ Exception \ InvalidArgumentException'与消息'找不到匹配UpdateDomainNameservers'的命令。我能够毫无误差地运行'$ client-> listHostedZones' – hellohellosharp
更新了有关'composer'的更多信息。检查是否这是你的。 – Dekel
更新SDK后,我意识到我的问题。我使用的是'Aws \ Route53 \ Route53Client;'而不是'Aws \ Route53Domains \ Route53DomainsClient'。谢谢您的回答! – hellohellosharp