composer update 出现内存不足 out of memory

解决办法1:运行命令时增大内存

php -d memory_limit=3G /usr/local/bin/composer update

解决办法2:不限制内存大小

php -d memory_limit=-1 /usr/local/bin/composer update

解决办法3:把php.ini的memory_limit增大

memory_limit=4096M

问题:

composer update安装package时,出现以下报错,内存不足

PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 134217736 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSet.php on line 83

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 134217736 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSet.php on line 83

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.

你可能感兴趣的:(composer update 出现内存不足 out of memory)