composer报错

composer报错:

[Composer\Downloader\TransportException]                                    
  Content-Length mismatch, received 134399 bytes out of the expected 1798606 

解决方法:(加载镜像)

阿里:composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

站点:https://developer.aliyun.com/composer

 

composer报错:

Installation failed, reverting ./composer.json to its original content.
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

proc_open(): fork failed - Cannot allocate memory

解决方法:

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

第一行:创建一个 1G 大小的文件
第二行:格式化该文件
第三行:将该文件挂载至文件系统中。
效果,内存大了一些

 

posted @ 2020-10-21 16:10  心之所依  阅读(260)  评论(0编辑  收藏  举报