1 安装 composer:
下载地址:https://getcomposer.org/Composer-Setup.exe
安装指定php.exe路径。
1 composer -version //查看当前版本
2 composer self-update //升级版本
3 composer config -g repo.packagist composer https://packagist.phpcomposer.com //使用中国镜像
4 composer install //当前路径安装vendor
2 安装yii 高级模板
composer create-project --prefer-dist yiisoft/yii2-app-advanced //下载高级模板
--stability=dev //安装最新版
3 安装初始化
>init
Yii Application Initialization Tool v1.0
Which environment do you want the application to be initialized in?
[0] Development
[1] Production
Your choice [0-1, or “q” to quit] 0
Initialize the application under ‘Development’ environment? [yes|no] y
Start initialization …
4 开发环境绑定域名和host
server {
listen 80;
server_name www.test.com ;
root "E:/myapp/yiiadv/www.test.com/frontend/web";
location / {
index index.html index.htm index.php;
#autoindex on;
if (!-e $request_filename){
rewrite ^/(.*) /index.php last;
}
}
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
}
5 访问域名,大功告成
6 goodnight