1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
2
When you run it locally, you have a different environment than when it runs via your web browser and your web server. Make sure you have your AWS credentials properly available to your script. You also should be able to look in your server error logs to see details of what's causing the error. Finally, you can surround the call to sendEmail([...])
with a try { sendEmail([...]); } catch (Exception $e) { echo "<pre>"; print_r($e); echo "</pre>"; }
to see if that catches the error and displays what's going on.
For our purposes, we have the AWS credentials in a text file on the server in a non-public path that the script can access and then we use the CredentialProvider to ... provide the credentials. ;)
use Aws\Credentials\CredentialProvider; use Aws\Ses\SesClient; $provider = CredentialProvider::ini('default', '/path/to/credentials.file'); $provider = CredentialProvider::memoize($provider); $sesClient = SesClient::factory([ 'region' => 'us-east-1', 'version' => 'latest', 'credentials' => $provider, ]);
답변함 2년 전
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 2년 전
I'm guessing this is an AWS credential issue but that is just a guess without a proper error message. Check your webserver's log file for a better error message?