Khi bạn thao tác với laravel nhưng xuất hiện lỗi: proc_open fork failed - Cannot allocate memory
Lỗi hiện thị
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
In Process.php line 344:
proc_open(): fork failed - Cannot allocate memory
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...
Cách fix lỗi
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
Test lại composer thấy ok ngay bạn nhớ 😄