转载地址:https://www.cnblogs.com/asworm/p/4886210.html
解决的问题:
1.composer安装fxp插件时候内存不足提示提示:Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar
2.npm install的时候经常自己killed
解决拌饭:
root@tyr:/var/www/html/laravel# free -m
total used free shared buffers cached
Mem: 488 414 74 24 1 71
-/+ buffers/cache: 340 147
Swap: 0 0 0
root@tyr:/var/www/html/laravel# /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 25.3413 s, 42.4 MB/s
root@tyr:/var/www/html/laravel# /sbin/mkswap /var/swap.1
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=60a9b908-925a-4161-8fca-7ae2d5a76154
root@tyr:/var/www/html/laravel# /sbin/swapon /var/swap.1
root@tyr:/var/www/html/laravel# free -m
total used free shared buffers cached
Mem: 488 474 13 24 2 127
-/+ buffers/cache: 344 143
Swap: 1023 0 1023