Laravel报错Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 671088...

在使用composer require "overtrue/laravel-wechat:~5.0"命令时,碰到laravel报错:Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 67108864 bytes) in phar:///usr/local/Cellar/composer/1.4.2/libexec/composer.phar/src/Composer/DependencyResolver/Solver.php on line 220。
刚开始修改了php配置文件php.ini中的memory_limit值如下:
memory_limit = -1
再执行命令仍然报一样的错误。
最后通过在require命令之前增加COMPOSER_MEMORY_LIMIT=-1解决,例如:
COMPOSER_MEMORY_LIMIT=-1 composer require "overtrue/laravel-wechat:~5.0"

你可能感兴趣的:(Laravel报错Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 671088...)