踩坑过程:
使用composer安装,没有梯子,所以检查了一下镜像源:
composer config -l -g
没有错,配置如下:
[repositories.packagist.org.url] https://mirrors.aliyun.com/composer/
按照提示,先将composer 更新,命令为composer self-update
更新至了2.0.6
然后执行composer create-project yiisoft/yii2-app-advanced [项目名]
执行一会儿后就卡在了
Updating dependencies (including require-dev)
本以为vendor目录较大,于是就等待
结果一会儿报出了
[Composer\Downloader\TransportException]
Operation timed out after 300001 milliseconds with 1683209 out of 6371282 bytes received
一看这怕是超时了吧,调大超时时间,调大内存结果还是不管用
于是查文档发现让安装一个插件fxp/composer-asset-plugin
使用命令安装该插件
composer global require "fxp/composer-asset-plugin:~1.4.5"
结果报错:
[InvalidArgumentException