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 😀

Article information

Published: September 1, 2016
Category: Laravel Tutorials
Reading time: 5-8 minutes
Difficulty: Intermediate

Key tips

1

Take your time to understand each concept before moving on to the next one.

2

Practice the examples in your own development environment for better understanding.

3

Don't hesitate to review the additional resources mentioned in the article.

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

Frequently Asked Questions

Categories

Page loaded in 25.62 ms