Hi,
I setup a Drupal 8 website via composer on a shared hosting.
I also installed 4 modules via composer and everything went fine.
From the 4th module on, I cannot install modules via composer anymore as I get a memory error. This is an example of command and output:
composer.phar require drupal/eu_cookie_compliance
Using version ^1.9 for drupal/eu_cookie_compliance
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///[…]/composer.phar/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.
Of course I checked the troubleshooting guide, but there was nothing useful for my case.
Also, the memory looks fine. This is the output of a couple of commands I used for the checks:
free -mh
total used free shared buffers cached
Mem: 15G 14G 1,5G 769M 90M 11G
-/+ buffers/cache: 3,1G 12G
Swap: 510M 130M 380M
php -r "echo ini_get('memory_limit').PHP_EOL;"
512M
Does anyone have any advice?
Thanks,
For information, this got fixed by executing
php -d memory_limit=-1 composer.phar require …