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
To fix this we must configure the 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 😀
Take your time to understand each concept before moving on to the next one.
Practice the examples in your own development environment for better understanding.
Don't hesitate to review the additional resources mentioned in the article.
Page loaded in 25.62 ms