Site Loader

If composer shows proc_open() fork failed on some commands:

PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar

This could be happening because the VPS runs out of memory and has no Swap space enabled.


free -m


total used free shared buffers cached
Mem: 2048 357 1690 0 0 237
-/+ buffers/cache: 119 1928
Swap: 0 0 0

To enable the swap you can use for example:


$ 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

Now Install or update composer


$ sudo COMPOSER_MEMORY_LIMIT=-1 composer install

Selim Reza

Selim Reza

Software Developer , MBA - NSU.

Follow us on Facebook

Just a Text Widget

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eu nulla vitae elit interdum sagittis.