Fortunately, I got into this that saved the day. I am sharing it, maybe it will save yours.
Depending on how many dependencies your project has, you may simply need more memory on your system. I’ve had to increase my virtual machine’s memory to at least 768mb in order to get
composer update to work in some situations.
However, if you’re doing this on a live server, you shouldn’t be using
composer update at all.
What you should do is:
composer updatein a local environment (either your physical machine, or a development virtual machine)
- Upload or git push the
composer installon the live server
composer installwill then read from the .lock file, fetching the exact same versions every time rather than finding the latest versions of every package. This makes your app less likely to break, and composer uses less memory.