swap 跑满了
composer安装 overtrue/laravel-wechat:~4.0 报错
vagrant@homestead:~/code/larabbs1.test$ composer require "overtrue/laravel-wechat:~4.0"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 9 installs, 0 updates, 0 removals
- Installing easywechat-composer/easywechat-composer (1.1.4): Downloading (conDownloading (100%)
proc_open(): fork failed - Cannot allocate memory
The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
Unzip with unzip command failed, falling back to ZipArchive class
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
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>]...
根据提供的链接,https://getcomposer.org/doc/articles/troub... ,
执行 free -m
vagrant@homestead:~/code/larabbs1.test$ free -m
total used free shared buff/cache available
Mem: 1993 816 921 62 255 955
Swap: 979 977 2
用满了,然后根据链接里面提供的命令,创建新的交换分区文件,扩大交换分区。
需要注意的一点,重启homestead之后这个交换分区文件的挂载就消失了,重新执行链接里面的命令
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
那就不在homestead里面composer require吧,直接在本机composer require