我正在使用AWS SDK for PHP通过SES发送电子邮件。我有一个用于发送电子邮件的PHP文件。当我使用AWS命令行界面(AWS CLI)运行此文件时,我可以发送电子邮件。但是,当我从浏览器尝试它时,我得到一个http 500错误。有人可以建议吗?
我得到以下描述: ' autoload.php'文件不在/ html文件夹中。我该如何允许打开它?此文件具有为公众开放的读取权限。
Fatal error: Uncaught Aws\Exception\CredentialsException: Error retrieving credentials from the instance profile metadata server. (Client error: `GET http://169.254.169.254/latest/meta-data/iam/security-credentials/` resulted in a `404 Not Found` response: <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "htt (truncated...) ) in /home/ec2-user/vendor/aws/aws-sdk-php/src/Credentials/InstanceProfileProvider.php:79 Stack trace: #0 /home/ec2-user/vendor/guzzlehttp/promises/src/Promise.php(203): Aws\Credentials\InstanceProfileProvider->Aws\Credentials\{closure}(Object(GuzzleHttp\Exception\ClientException)) #1 /home/ec2-user/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(2, Array, Array) #2 /home/ec2-user/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}() #3 /home/ec2-user/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(96): GuzzleHttp\Promise\TaskQueue- in /home/ec2-user/vendor/aws/aws-sdk-php/src/Credentials/InstanceProfileProvider.php on line 79