简体   繁体   English

Ubuntu服务器上的Laravel Lumen Mail和Amazon SES 500内部服务器错误(生产)

[英]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: 我已经对现有的Stack Overflow当前问题进行了两次,三次的检查:

  • .env has all the correct creds.. all Amazon SES req. .env具有所有正确的信誉..所有Amazon SES要求。
  • Fixed/reviewed all Laravel Mail req. 修复/审查了所有Laravel Mail要求。
  • Changed MAIL_DRIVER = log 已更改MAIL_DRIVER =日志

Everything works fine on localhost.. perfect 一切都可以在本地主机上正常工作。

Set everything up on Ubuntu, fails. 在Ubuntu上进行所有设置,均失败。 If I comment out the Mail part, I get the response message that would come directly after the Mail lines of code. 如果我注释掉Mail部分,则会得到响应消息,该响应消息将直接出现在Mail代码行之后。

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 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. 另外,我的域由AWS Route 53管理,并指向Digital Ocean Ubuntu Server IP地址。

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 ); ini_set('display_errors',1); error_reporting( E_ALL ); 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... 通过添加以上内容,我能够开始在页面中立即获得错误响应,这使我导航到存储/日志,因为它们没有在Ubuntu中设置正确的权限,因此我执行了以下操作...

sudo chmod -R 777 storage sudo chmod -R 777 storage/lumen.log sudo chmod -R 777存储器sudo chmod -R 777存储器/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. 我还发现您需要在Ubuntu上安装sendmail,以便可以使用SMTP,发送测试邮件,然后将其保存在我的SPAM文件夹中。

Then did a simple PHP mail test, worked, ended up in my SPAM folder. 然后做了一个简单的PHP邮件测试,成功了,最终保存在我的SPAM文件夹中。

Ran a third test, changed MAIL_DRIVER=log and sent another email, this ended up on storage/lumen.log 进行了第三项测试,更改了MAIL_DRIVER = log并发送了另一封电子邮件,该电子邮件最终存储在storage / lumen.log上

Fourth test, sent email with SES settings, and email went through and arrived in my inbox - yahh! 第四项测试,发送带有SES设置的电子邮件,并且电子邮件通过并到达了我的收件箱-是的!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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