Laravel Tutorials 5-8 minutes

Error Composer Install Server Caused by Lack of Memory

Diego Cortés
Diego Cortés
Full Stack Developer & SEO Specialist
Share:
Error Composer Install Server Caused by Lack of Memory

When uploading a Laravel 5 project to a VPS server and performing composer install, it throws the following error:

Installation failed, reverting ./composer.json to its original content. The following exception is caused by a lack of memory and not having swap configured Check
 https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details

Solution:

To fix this we must configure the Swap File within the VPS

Configuring Swap File within the VPS

First, we create an empty 1GB file by typing:

sudo fallocate -l 1G /swapfile

We format this as a swap file:

sudo mkswap /swapfile

Finally, we enable the swap file so that it starts to be used:

sudo swapon /swapfile

Now we can run our composer install within our Laravel 5 project, I hope it helps more than one 😀

Categories

Page loaded in 35.52 ms