1

I try install module via composer.

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.

I change in php.ini memory_limit to 1024M

Still the same issue.

Any solution?

1
  • From your OS Command Prompt, please post TEXT results of A) TOP and B) HTOP so we can see how much RAM you have available. Dec 23, 2022 at 16:31

3 Answers 3

5

you need to change memory limit to 2048M- you have 1.5Gb in error log. or try to use direct memory settings

php -d memory_limit=-1 composer require "vendor/package"
0

You can use the below command for setting the memory limit as unlimited

php -d memory_limit=-1 composer require "vendorName/ModuleName"

Another way you can change memory_limit=-1 in php.ini file

0

Just give -1 as memory_limit value. The composer command in this case becomes the argument of php command, so you need to provide its absolute path. Or you can use the which command

php -d memory_limit=-1 $(which composer) require "vendor/package"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.