yii2.0高级版使用

yii2.0高级版高级版与基础版本的区别在于高级版有两个入口:前台和后台

1、安装下载:进入yii中文网 http://www.yiichina.com/download进行高级版和基本版的下载

2、高级版下载完成后,不能直接使用,需完成以下几个步骤

     (1)分别为前台和后台配置域名

         如:前台域名yii.frontend.com    站点位置D:\phpStudy\WWW\pnk\yiiadvanced\frontend\web

        后台台域名yii.backend.com    站点位置D:\phpStudy\WWW\pnk\yiiadvanced\backend\web

    (2)为域名指向本地dns,打开hosts文件,为域名配置127.0.0.1 yii.frontend.com yii.backend.com

    (3)隐藏index.php文件,打开vhosts-conf(apach里的httpd.conf)文件,加入如下代码

RewriteEngine on

# 如果请求的是真实存在的文件或目录,直接访问
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# 如果请求的不是真实文件或目录,分发请求至 index.php
RewriteRule . index.php

# if $showScriptName is false in UrlManager, do not allow accessing URLs with script name
RewriteRule ^index.php/ - [L,R=404]

     如下图所示:

        

  (4)初始化init文件,打开cmd->进入项目根目录-》输入php init-》选择开发/生产模式,输入0,即选择开发模式-》确认选择开发/生产模式,输入yes

猜你喜欢

转载自www.cnblogs.com/wushibenxin/p/9079109.html