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?

asked Mar 21, 2020 at 14:50
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. Commented 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"
answered Mar 21, 2020 at 17:46
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

answered Dec 22, 2022 at 12:55
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"
answered Jul 28, 2023 at 14:49

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.