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 😀
Page loaded in 37.59 ms