Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vitte's avatar
Level 1

PHP Fatal error: Allowed memory size of

[31-Mar-2022 17:00:16] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in vendor\laravel\framework\src\Illuminate\Database\Connection.php on line 332 [31-Mar-2022 17:00:16 ] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes) in \vendor\symfony\debug\Exception\FatalErrorException.php on line 1

This keep happening in the application when any insertion is done (Taking About Store Method in Laravel) when I Increase the memory limit php.ini it works. but I think is not a permanent solution.

0 likes
2 replies
Braunson's avatar

Do you have xdebug enabled, if so turn it off and try again! Are you inserting a very large query, if so try chunking/batching it instead. Are you using a recent version of Laravel? If not it could be a bug in a previous version.

Best thing to do is find out what's causing the memory issue and from there you can figure out a solution.

vitte's avatar
Level 1

i have installed Laravel debag bar after this issues stated. and my application is using Laravel 5.7. Store method is very short and simple.

Please or to participate in this conversation.