Cannot send email via aws-ses from https request?

梦想的初衷 提交于 2019-12-25 10:05:09

问题


I am using the AWS SDK for PHP to send email via SES. I have a PHP file that i use to send email. When i use the AWS Command Line Interface (AWS CLI) to run this file I can send email. However, when i try it from the browser I get a http 500 error. Please can someone advise?

I am getting the following trace: The 'autoload.php' file is not located in the /html folder. How can I allow this to be opened? This file has read access opened for the public.

 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

来源:https://stackoverflow.com/questions/48128523/cannot-send-email-via-aws-ses-from-https-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!