Composer installs plugins with insufficient memory

Posted May 25, 20201 min read

Recently, when the command composer require phpoffice/phpspreadsheet was used to install phpspreadsheet, there was insufficient memory and the following error occurred:

The following exception is caused by a lack of memory or swap, or not having swap configured

Solve it perfectly with the following methods:

sudo/bin/dd if =/dev/zero of =/var/swap.1 bs = 1M count = 1024
sudo/sbin/mkswap /var/swap.1
sudo/sbin/swapon /var/swap.1

Related Posts