当前位置 > it书童 > php > 正文

解决 composer 安装包报内存溢出的问题

php it书童 2020-04-21 13:42:39 0赞 0踩 133阅读 0评论

安装 jwt-auth 包时,一直提示内存不足,即使我已经将 php.ini 的内存扩大到了 1G,也没用

$ composer require tymon/jwt-auth
Using version ^1.0 for tymon/jwt-auth
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
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

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

解决方案:

$ php -d memory_limit=-1 /usr/local/bin/composer require tymon/jwt-auth -vvv

参考链接

转载须注明出处:https://www.itshutong.com/articles/489/solve-the-problem-of-memory-overflow-reported-by-composer-installation-package
关于我
一个文科出身的程序员,追求做个有趣的人,传播有价值的知识,微信公众号主要分享读书思考心得,不会有代码类文章,非程序员的同学请放心订阅
发表评论
我有句话,不知当讲不当讲?
要讲之前请先 登录