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?
- 
 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.Wilson Hauck– Wilson Hauck2022年12月23日 16:31:55 +00:00Commented Dec 23, 2022 at 16:31
3 Answers 3
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"
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
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"