Ive been trying to composer install and composer update on an EC2 AWS instance, and it always hangs on same package: symfony$thanks.json
Reading /root/.cache/composer/repo/https---repo.packagist.org/provider-symfony$thanks.json from cache
Im aware that I probably need to increase memory size for this action so i also ran it with the command
php -d memory_limit=-1 /var/www/html/composer.phar update/install
but it always get stuck on the same package, and hangs without moving (ive already waited 20 minute, just in case)
I tried to install this package by it self and then I got the error of:
mmap() failed:  Cannot allocate memory PHP Fatal error: Out of memory (allocated 557694976) (tried to allocate 20480 bytes) i n phar:///usr/local/bin/composer/src/Composer/Repository/ComposerRepository.php on line 348 Fatal error: Out of memory (allocated 557694976) (tried to allocate 20480 bytes) in pha r:///usr/local/bin/composer/src/Composer/Repository/ComposerRepository.php on line 348 [[email protected] html]# mmap() failed:  Cannot allocate memory bash: syntax error near unexpected token `failed:'
I already tried:
- composer clear-cache
- composer self-update
- all the php artisan clear commands
- updating composer and vendor on local and then upload them to AWS
What I didnt try:
the various swap method I read online, I dont really like to execute commands I dont fully understand.
any assistance will be highly appreciated
Source: Symfony Questions