你正在使用哪個版本的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