EN ES
Home > Web development > Laravel Tutorials > Error Composer Install Server Caused by Lack of Memory

Error Composer Install Server Caused by Lack of Memory

Diego Cortés
Diego Cortés
September 1, 2016
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 😀

Diego Cortés
Diego Cortés
Full Stack Developer, SEO Specialist with Expertise in Laravel & Vue.js and 3D Generalist

Categories

Page loaded in 37.59 ms