Composer require Fatal error: Allowed memory size of 1610612736 bytes exhausted

Composer update tried to allocate more bytes

Panjeh
1 min readFeb 10, 2021

Suppose you run composer update or composer require like:

composer require laravel/framework

and see such fatal error:

If you encounter such issue after running composer require, you don’t have to touch or update the PHP INI file.

How to solve Composer error about running out of memory?

The solution is to run only this:

COMPOSER_MEMORY_LIMIT=-1 composer require Vendor/PackageName

Example:

COMPOSER_MEMORY_LIMIT=-1 composer require laravel/frameworkorCOMPOSER_MEMORY_LIMIT=-1 composer update

Reason of this error:

This is because of the fact in composer.json file most of the packages has a version like 6.* and this causes to load much memory. If you want to correct such error fundamentally, you should refer to them more specifically like 6.1.1

I would like to introduce two packages for Laravel that I have recently developed: Laravel Pay Pocket, a modern multi-wallet package, and Laravel Failed Jobs, a UI for the Laravel Failed Jobs Table. I hope they may be of help to you.

https://github.com/HPWebdeveloper/laravel-pay-pocket
https://github.com/HPWebdeveloper/laravel-failed-jobs

--

--

Panjeh
Panjeh

Written by Panjeh

Posting about Python and Laravel

No responses yet