How to Install Yii Framework
Install YII basic & How to run Project
#With Composer installed, you can install Yii application template by running the following
command under a Web-accessible folder:
composer create-project --prefer-dist yiisoft/yii2-app-basic basic
#If you want to install the latest development version of Yii, you may use the following command instead
composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic
#Run project using cmd
php yii serve
Using VirtualHost
ServerName: basic.dev
Directory: "basic/web"
#Copy /requirements.php to /web/requirements.php and then use a browser to access it via http://localhost/requirements.php
#Run the following commands:
cd basic
php requirements.php
Install YII2-app-advanced & How to run Project
You can then install the application using the following commands:
composer global require "fxp/composer-asset-plugin:~1.1.1"
composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application
#DB file
yii-application\environments\dev\common\config\main-local.php
#Execute the init command and select dev as environment.
init
#Apply migrations with console command:
yii migrate
or for windows:
php yii migrate
#Run project
for frontend yii-application/frontend/web/
for backend yii-application/backend/web/
Using VirtualHost
ServerName: frontend.dev
Directory: "/path/to/yii-application/frontend/web/"
ServerName: backend.dev
Directory: "/path/to/yii-application/backend/web/"