yii2.0-advanced 高级版项目搭建(一)

原文链接 http://www.yii-china.com/post/detail/1.html

项目搭建:

  1. 点击上方“资源下载”下载本教程所需的yii2.0高级版框架

  2. 下载之后,解压后里面有advanced文件夹,打开得到如下图所示的目录mulu.png

  3. 目录结构的介绍就不在这里详细说明了,我们主要认识的是三个目录 backend(后台)、common(公用)、 frontend(前台)。

  4. 打开C:\Windows\System32\drivers\etc\hosts 将下面代码复制到hosts文件中(如下图)

      127.0.0.1   admin.demo.com  
      127.0.0.1   www.demo.com

    host.png

  5. 将上面解压的advanced项目文件拷贝到环境根目录,配置访问目录,打开\apache\conf\extra\httpd-vhosts.conf(修改之后重启一下apache服务)

      <VirtualHost *:80>     
          DocumentRoot "F:\pro\advanced\frontend\web"     
          ServerName www.demo.com     
          ServerAlias www.demo.com  
      </VirtualHost>  
      
      <VirtualHost *:80>     
          DocumentRoot "F:\pro\advanced\backend\web"     
          ServerName admin.demo.com     
          ServerAlias admin.demo.com  
      </VirtualHost>

      注:F:\pro为本人的本地环境根目录,根据各自环境的实际情况而定

  6. 把php.exe加入系统环境变量

    步骤:

    1.右击我的电脑-属性-高级-环境变量

    2.找到 Path 这一项(可能需要向下滚动才能找到),鼠标双击 Path 这一项,在最后加入你的 PHP 目录和类库所在的路径,包括前面的“;”(例如:;C:\php;C:\php\ext)

    3.点击“新建”按钮并在“变量名”中输入“PHPRC”,在“变量值”中输入 php.ini 文件所在的目录(例如:C:\php) ,这个步骤是为了让windows找到php.ini.

    4.运行CMD 进入安装目录中,执行init或在安装目录中运行init.bat,选择 0 开发模式进行安装

  7. 打开浏览器访问http://www.demo.com就能看到前台界面了,http://admin.demo.com是后台界面(出现一个登陆界面)

    index.pngindex.png

  8. 原文链接 http://www.yii-china.com/post/detail/1.html

转载于:https://www.cnblogs.com/yii-china/p/5545077.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
基于Yii 框架开发的博客!用于学习YII。 DLFBLOG 1.0 基于Yii 框架开发的博客! Quick start Clone the repo, git clone git://github.com/windsdeng/dlfblog.git, or download the latest release. Bug tracker Have a bug? Please create an issue here on GitHub! Also, when filing please make sure you're familiar with necolas's guidelines. thanks! <3 https://github.com/windsdeng/dlfblog/issues DLFBLOG DEMO http://demo.dlf5.net QQ交流群 1、185207750 Author WindsDeng http://www.dlf5.com https://github.com/windsdeng http://www.weibo.com/windsdeng http://1.t.qq.com/fz-iloveyou Copyright and license The DLFBLOG is free software. It is released under the terms of the following BSD License. Copyright © 2012 by DLF5.NET (http://www.dlf5.net) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of DLF5.NET nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 标签:dlfblog

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值