执行composer require "overtrue/laravel-wechat:~5.0"报错 Allowed memory size of 1610612736 bytes exhauste

周锐
2023-12-01

在执行composer require "overtrue/laravel-wechat:~5.0"

报错

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

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
的解决办法:

查看memory的大小

php -r "echo ini_get('memory_limit').PHP_EOL;"
 COMPOSER_MEMORY_LIMIT=-1 composer require "overtrue/laravel-wechat:~5.0"

在执行命令前加: COMPOSER_MEMORY_LIMIT=-1  临时修改memory的大小

 类似资料: