1.打开到项目的目录，举例如我的项目位于D:www下命令行：cmd-->cd D:\www\ D: D:\www> 2.安装Yii2输入以下命令进行安装yii2 高级模板composer create-project --prefer-dist yiisoft/yii2-app-advanced kmoa如果出现Loading composer repositories with package information 卡住不动这更改下composer的源镜像为国内《composer安装出现Loading composer repositories with package information卡住不动》CTRL+C中断当前，输入yes。重来3.设置国内镜像 composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ 4.重新安装 composer create-project --prefer-dist yiisoft/yii2-app-advanced kmoa 5.安装成功但加载库失败 见图（因为墙的缘故）6.打开kmoa目录 增加阿里云镜像 "repositories": [ { "type": "composer", "url": "https://mirrors.aliyun.com/composer/" }, { "type": "composer", "url": "https://asset-packagist.org" } ]7.执行composer install安装中...8.安装成功9.初始化