简体   繁体   中英

Laravel Lumen Mail and Amazon SES 500 Internal Server Error on Ubuntu Server (Production)

Spent a good deal of time reviewing this...

What I've double, triple checked and against existing Stack Overflow current issues:

  • .env has all the correct creds.. all Amazon SES req.
  • Fixed/reviewed all Laravel Mail req.
  • Changed MAIL_DRIVER = log

Everything works fine on localhost.. perfect

Set everything up on Ubuntu, fails. If I comment out the Mail part, I get the response message that would come directly after the Mail lines of code.

I'm thinking whether it has anything to do with pointing to the public folder and then the route?

www.domain.com/api/public/routename

Also, my domain is managed by AWS Route 53 and points to a Digital Ocean Ubuntu Server IP address.

Any ideas appreciated. Thank you!

Okay, solved it!

Here's everything I did to solve the above issue...

Added the following to the top of my routes file:

ini_set( 'display_errors', 1 ); error_reporting( E_ALL );

By adding the above I was able to start getting immediate error responses in the page, this navigated me to storage/logs in that they didn't have the correct permissions set in Ubuntu, so I did the following...

sudo chmod -R 777 storage sudo chmod -R 777 storage/lumen.log

I also found out you needed to have sendmail installed on Ubuntu so that SMTP would be available to use, sent a test mail out and this ended up in my SPAM folder.

Then did a simple PHP mail test, worked, ended up in my SPAM folder.

Ran a third test, changed MAIL_DRIVER=log and sent another email, this ended up on storage/lumen.log

Fourth test, sent email with SES settings, and email went through and arrived in my inbox - yahh!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM