0

I am trying to run composer require and it is giving me this error:

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

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

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

When I run php -r "echo ini_get('memory_limit').PHP_EOL;" I can see that my memory limit is set to 2048M which should be more than enough. I tried running it like this COMPOSER_MEMORY_LIMIT=-1 composer require but it just gives me this:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Killed

I have tried restarting my computer and that didn't work either. It is worth mentioning that composer update and composer install work just fine.

I am running Composer version 1.8.6.

Does anyone know what I can do here?

L. Fox
  • 328
  • 1
  • 6
  • 20

0 Answers0