If you are running out of memory like that, it usually points to some sort of recursion.
The main cause of this is having two models both using with to load the other relation.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 16384 bytes) in C:\xampp\htdocs\cods\vendor\laravel\framework\src\Illuminate\Database\Connection.php on line 331
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 32768 bytes) in C:\xampp\htdocs\cods\vendor\symfony\error-handler\Error\FatalError.php on line 1
Above are the errors I'm getting just trying to connect the server in terminal (php artisan serve) in PHPStorm 2019.3. This is immediately after a reboot, not even a browser window open. xampp control panel is running, server started.
I'm a noob so most of this is over my head.
Problem started a little after I performed "composer require --dev barryvdh/laravel-ide-helper" hoping to clear up some confusing phpstorm warnings/notices. Everything was ok for about a day, then pages wouldn't load, so I stopped the server, tried to start again. Have gotten that error ever since. I just now did "composer remove ... (same) " and it went thru its motions, looks like it removed it all, but I still get the errors when I try to connect to the server. No browser open, not trying to run anything, so not a data problem, right?
I saw some other stackO advice on changing memory size in php.ini, but if I haven't done anything different, and I'm not even running any code, I can't figure why I would need to increase memory. Unless someone here advises different, I wouldn't want to change config files that always worked. Would really appreciate some help.
If you are running out of memory like that, it usually points to some sort of recursion.
The main cause of this is having two models both using with to load the other relation.
Please or to participate in this conversation.