Composer Update PHP Fatal error: Allowed memory size of … byte exhausted
1 min readApr 22, 2020
At the present moment there is a bug on Composer causing memory to be exhausted by run composer install
or composer update
. Detail error should be like
PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 134217736 bytes) in phar:///usr/local/Cellar/composer/1.9.0/bin/composer/src/Composer/DependencyResolver/RuleSet.php on line 84
For fix this issue, at first, you need to be sure that your composer itself is updated to the latest version:
php composer.phar --self-update
// or
composer self-update
Then delete a folder inside vendor
rm -rf vendor/laravel
and do
composer update
If you still facing this bug, which it is not supposed to run out of memory, for now you can fix it for yourself by doing:
php -d memory_limit=-1 /usr/local/bin/composer update
Also, check this thread, they are about to fix this.
Bonus Update:
You can also use this for faster installation (at least I think its faster for me)
COMPOSER_MEMORY_LIMIT=-1 composer install --no-dev -vvv