PHP致命错误:允许内存大小为1610612736字节的composer更新



我想通过运行以下命令来运行对我的Laravel项目的命令编写器更新。

composer update

当我尝试运行composer require时,我得到了内存不足的错误。

PHP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223
Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223
Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.

运行

which composer

这将为你提供一条通往作曲家风格的道路/usr/bin/comporter";

然后在下面的命令中使用该路径来克服内存限制,使用php标志表示没有内存限制,如下所示:

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

运行

COMPOSER_MEMORY_LIMIT=-1 composer update

这会暂时将作曲家的内存限制设置为无限制。

最新更新