Out of memory when running large queries in Laravel

It's only fair to share...Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInShare on StumbleUponEmail this to someone

Have you ever faced “Out of memory” issue when running some large queries in Laravel?

By default, laravel will keep log all queries in memory, and at some points it can cause your app to use excess memory.
Try adding lines below in your controller to solve this issue.

Or

It will disable query log in laravel. If you still get the error, try to raise memory limit in your php configuration file.

If it still exists, you have to start reviewing your database queries.

 

It's only fair to share...Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInShare on StumbleUponEmail this to someone