YII2下載地址:http://www.yiichina.com/downloadphp
高級版本和基本版本的區別是:web
基礎版只有一個只有一個web應用,高級版則生成先後臺。建議使用高級版,方便
Yii2框架搭建環境步驟: 1. 配置環境域名(目的:一個域名的目的是便於記憶和溝通的一組服務器的地址(網站,電子郵件,FTP等)),步驟爲: a. 在host文件中配置域名:C:\Windows\System32\drivers\etc\hosts中添加以下配置: 127.0.0.1 frontend.advance.com 127.0.0.1 backend.advance.com a. 在apache配置訪問目錄和地址:D:\phpStudy\Apache\conf\vhosts.conf中添加配置:
<VirtualHost *:80> ServerName frontend.advance.com DocumentRoot "D:/yii/advanced/frontend/web" </VirtualHost> <VirtualHost *:80> ServerName backend.advance.com DocumentRoot "D:/yii/advanced/backend/web" </VirtualHost>
2. 配置環境變量(目的:配置入口文件) D:\phpStudy\php\php-5.4.45(php.exe所在目錄) 3. 運行初始化腳本(項目下的init.bat)在運行初始化腳本的時候可能會遇到初始化失敗:緣由有多是 php openssl 擴展沒有打開