3分钟搞定YII2框架advanced版安装配置(5个超详细步骤
2017-10-10 本文已影响181人
三不小青年
基础配置和开发环境:Wampserver 集成开发环境(php+mysql+apache)
下载文件:YII高级应用开发程序模板
1:将下载的文件解压重命名为 test 放到www目录下
![](https://img.haomeiwen.com/i7872413/5800662f5dccd7f3.png)
2:开启Apache的重启路由模块
![](https://img.haomeiwen.com/i7872413/200d0320be5a5352.png)
3:确保引入了虚拟主机的配置文件(去掉 Include conf/extra/http-vhosts.conf) 前面的#号
![](https://img.haomeiwen.com/i7872413/6bcb9a02185dedce.png)
4:配置虚拟主机
![](https://img.haomeiwen.com/i7872413/9377b2a3015519a2.png)
ServerName yii2.login DocumentRoot D:\wamp\www\yii2\test\backend\webRequire all granted
Allow from all
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
这里粘贴的时候无法完整粘贴,可移步到我师傅的github
之后重启 Apache 服务
配置C盘的hosts :添加 127.0.0.1 yii2.login
![](https://img.haomeiwen.com/i7872413/b186a34ecc0193f9.png)
5初始化index.php入口文件
经过干菜的一系列配置,当我们在浏览器中输入yii2.login/index.php发现提示404 Not Found
![](https://img.haomeiwen.com/i7872413/f10a056282dc9fcb.png)
右键我的电脑属性->高级系统设置->高级->环境变量 Path下面添加正在使用的php 的文件目录
![](https://img.haomeiwen.com/i7872413/d36088841c35c46b.png)
![](https://img.haomeiwen.com/i7872413/58407495c907705d.png)
刚才配置环境变量的目的是为了让我们在开发软件的额控制面板能够执行 php init 命令
![](https://img.haomeiwen.com/i7872413/a02197e40c4b5a06.png)
最后输入yii2.login 显示进入后台登录页面,恭喜已经完成了配置!
![](https://img.haomeiwen.com/i7872413/18c4a677a365b3cd.png)