- 安装好大于5.4或更高版本的PHP环境并开启openssl扩展.如果是Apache服务器,加载Apache的mod_ssl模块.
- 下载Composer并安装.
- 开始->运行【或者WIN+R】->cmd,在命令行下输入composer,查看composer是否安装成功:

- 如果composer安装成功:
执行composer self-update命令更新Composer为最新版本,然后进入你要安装yii的有效web目录
- 安装Composer asset plugin:
composer global require "fxp/composer-asset-plugin:~1.1.2",最后的~1.1.2是你composer的最新版本号

- 安装Yii2在有效web目录下的yii目录
composer create-project

输入您github账户的Token,耐心等待安装.安装成功后在浏览器输入http://localhost/yii/web/index.php,出现如下界面,安装成功!

如果没有出现这个界面,可以通过【在浏览器输入http://localhost/yy/requirements.php】或者【在命令行进入requirements.php所在目录,执行php requirements.php】来查看是否满足Yii最基
本需求.
http://www.yiichina.com/tutorial/804