proc_open(): fork failed – Cannot allocate memory laravel in ubuntu

Share Me
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Now in this article, we will install new laravel project in composer to define command then have a error to display in composer proc_open(): fork failed – Cannot allocate memory size.

Now in this article, we will find the best solution for issue:

The following exception is caused by a lack of memory or swap, or not having swap configured
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details                                                    
[ErrorException]                                   
proc_open(): fork failed - Cannot allocate memory

At first check our swap with this command:

Run Following Commands:

free -m
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

Read Also : PHP Laravel File Upload with Progress Bar Example

Thanks for read. I hope it help you. For more you can follow us on facebook

About code chef

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by code chef →