composer 安装插件提示内存不足等问题

今天给laravel安装Excel插件提示了内存分配不足等一大堆问题:

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

 

PHP Warning:  proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 979

 

Warning: proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 979

                                                     

  [ErrorException]                                   

  proc_open(): fork failed - Cannot allocate memory 

 

然后根据错误提示访问了:https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors

根据提示运行了解决错误的命令


/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1

问题解决!

你可能感兴趣的:(laravel,php)