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


异常背景

Laravel 安装 tymon/jwt-auth包时,

vagrant@homestead:~/share/el$ composer require tymon/jwt-auth

抛出异常错误:

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

查阅资料有两种解决方案:
1、去php的配置文件php.ini中找到memory_limit配置,把配置改为memory_limit=-1,重启php服务器
2、命令运行脚本:

composer -h 查看composer的路径

vagrant@homestead:~/share/el$ compser -h
Help:
  The help command displays help for a given command:
  
    php /usr/local/bin/composer help list
  
  You can also output the help in other formats by using the --format option:
  
    php /usr/local/bin/composer help --format=xml list
  
  To display the list of available commands, please use the list command.

运行脚本 php -d memory_limit=-1 /usr/local/bin/composer require tymon/jwt-auth

vagrant@homestead:~/share/el$php -d memory_limit=-1 /usr/local/bin/composer require tymon/jwt-auth


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM