Sometimes, when you run any composer command in Laravel project, you may get error 'proc_open(): fork failed - Cannot allocate memory'. Here is the full error I got when running command composer update:
This could be happening because the VPS runs out of memory and has no Swap space enabled. You can check the current memory and swap using command:
free -m
It will return memory like below:
You need to enabled swap with following commands:
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
If the above commands not work, then you can try to create a swap file.
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
And now you can use composer command.
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
Failed to listen on 127.0.0.1:8000 (reason: Address already in use)
Laravel is the most popular and open-sou...How to Trigger a Click on a Link Using jQuery
Use the jQuery click() Method You can...How to Import SQL Files into a MySQL database using Command Line
In this article, I will share with you h...Django 3 Multiple File-Image Upload with Angular 9
In the precedent tutorial we have optica...PHP Count Number of Pages in PDF File
In this post, I will give you a simple e...