Home  >  Article  >  Development Tools  >  What should I do if composer runs out of memory? Two step solution!

What should I do if composer runs out of memory? Two step solution!

藏色散人
藏色散人forward
2021-11-17 14:28:042743browse

This article is written by the tutorial column of composer to introduce to you the problem of insufficient memory in composer. I hope it will be helpful to friends in need!

What should I do if composer runs out of memory? Two step solution!

composer Insufficient memory?

The error message is as follows

PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223
Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223
Check getcomposer.org/doc/article… for more info on how to handle out of memory errors.

#Cause Insufficient memory

Solution

1. Modify php.ini

2. Temporarily release the memory limit when executing composer

COMPOSER_MEMORY_LIMIT =-1 composer require "package name"

###

The above is the detailed content of What should I do if composer runs out of memory? Two step solution!. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:juejin.im. If there is any infringement, please contact admin@php.cn delete