我对PHP/LARAVEL开发非常陌生,试图开发一个应用程序来发送来自smtp.gmail.com的电子邮件。
我的错误就像
[ Tue Jan 11 17:11:32.765352 2022 pid 21752:tid 1952年PHP致命错误:允许内存大小为耗尽268435456字节(试图分配132124672字节)]
在以下代码行中:
try {
Mail::to($user->email)->send(new SendMail($message1,$notification_template->subject));
}
catch (\Throwable $th) {
throw $th;
}我已经尝试将memory_limit设置为-1(无限制)或php.ini中的2048M,但没有运气。从XAMPP和VSCode获得相同的错误。
我使用gmail作为SMTP服务器发送电子邮件。
你能帮我理解并解决这个问题吗?
发布于 2022-01-12 08:44:41
以下文件中的
更改--这将解决您的问题:
File: /etc/php.ini
memory_limit = 512M;https://stackoverflow.com/questions/70667567
复制相似问题