0

Am running laravel/framework:"^6.2" and every time I try to run composer require laravelcollective/html I get this error message

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.

Any Ideas on how to solve this?

  • The correct way is to edit your `php.ini` file. Edit `memory_limit` to your desire value. – STA Jul 31 '20 at 20:32
  • Thanks, I found the php.ini file and the current `memory_limit=1000M`, what value would you suggest in my case? – George Monk Jul 31 '20 at 20:37
  • 1000M is to big, dont know why you get this error with `laravelcollective/html` you can change it too 5000M for your development purpose – STA Jul 31 '20 at 20:38
  • 1
    Thanks, it worked. – George Monk Jul 31 '20 at 20:42
  • Changing this in your php.ini just to make composer work is a bad idea, as now any script you run can allocate _far_ more memory than what is probably reasonable. See [this answer](https://stackoverflow.com/a/36107762/1064767), particularly the 2020 update, and update your composer version. – Sammitch Jul 31 '20 at 21:02
  • @Sammitch thanks for the suggestion, I have changed the `memory_limit=-1` and updated my composer – George Monk Jul 31 '20 at 21:13

0 Answers0