Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
与PHP连接时,AWS SQS标记无效,但与Python连接时可以_Php_Amazon Web Services_Aws Php Sdk - Fatal编程技术网

与PHP连接时,AWS SQS标记无效,但与Python连接时可以

与PHP连接时,AWS SQS标记无效,但与Python连接时可以,php,amazon-web-services,aws-php-sdk,Php,Amazon Web Services,Aws Php Sdk,我在尝试连接AWS SQS时遇到了一个非常特殊的问题。运行此PHP代码时: $client = SqsClient::factory(array( 'credentials' => [ 'key' => 'somekey', 'secret' => 'somesecret' ], 'region' => 'eu-west-1', 'version' => 'latest' )); $result = $c

我在尝试连接AWS SQS时遇到了一个非常特殊的问题。运行此PHP代码时:

$client = SqsClient::factory(array(
    'credentials' => [
       'key' => 'somekey',
       'secret' => 'somesecret'
    ],
    'region'  => 'eu-west-1',
    'version' => 'latest'
));
$result = $client->receiveMessage(array(
    'QueueUrl' => $queueUrl,
));
我得到了这个错误:

PHP Fatal error:  Uncaught exception 'Aws\Sqs\Exception\SqsException' with message 'Error executing "ReceiveMess
age" on "https://sqs.eu-west-1.amazonaws.com/189729872213/my-very-special-queue"; AWS HTTP error: Client error: 403 Inva
lidClientTokenId (client): This account is suspended - <?xml version="1.0"?><ErrorResponse xmlns="http://queue.a
mazonaws.com/doc/2012-11-05/"><Error><Type>Sender</Type><Code>InvalidClientTokenId</Code><Message>This account i
s suspended</Message><Detail/></Error><RequestId>aaf63243-6840-5b49-893a-7d66919c07da</RequestId></ErrorResponse
>'
但是,当我在同一台机器上使用具有相同凭据的boto(相当于AWS PHP SDK的Python)时,它工作得很好!该帐户按预期打开,我可以访问与其关联的所有队列

如何使PHP代码正常工作?我应该检查什么