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

matthew230's avatar

New project install: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 421768368 bytes)

I am new to Laravel, I have installed PHP and Laravel in a Docker container.

From installation tutorials, I was expecting a Laravel Homepage, however I am getting a memory error.

For avoidance of doubt, I have not adjusted any code. I've taken the PHP right up to 3GB, with the same result.

Symfony \ Component \ ErrorHandler \ Error \ FatalError Allowed memory size of 2147483648 bytes exhausted (tried to allocate 421768368 bytes)

PHP 8.2.7, Laravel 10.24.0

I'm running it using an Apache Bullseye image.

If I run a core PHP file from the server, and utilise a high memory usage test, it works fine. Once the index.php file gets to:

$response = $kernel->handle( $request = Request::capture() )->send(); $kernel->terminate($request, $response);

It breaks. Seems there is likely a loop somewhere, but I'm not clear on how a fresh install project with no adjusted code can create that?

Any ideas very welcome?

0 likes
4 replies
Tray2's avatar

Have you restarted the server after updating the memory setting, and have you made the change in the right php.ini?

matthew230's avatar

Hi Tray,

Thanks for responding.

Yes. the allowed memory of 2147483648 indicates it is allowing 2gb. I've also watched the docker stats, and you can see the container using the memory. So I don't think that is the issue.

Even if it were, would a blank Laravel install need more than the standard 128mb just to show the home page?

nickrushuniq's avatar

Hello. I solve this problem when I give all permission to folder "storage" chmod 777 -R /myproject/storage

Please or to participate in this conversation.