Yii2 can be installed in two ways. They are
If you do not already have Composer installed, you may do so by following the instructions at getcomposer.org. On Linux and Mac OS X, you'll run the following commands:
curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer
For windows just download and install composer-setup.exe You may have to configure the github API access token to overide Github API rate limit.
With Composer installed, you can install Yii by running the following commands under a Web-accessible folder:
composer global require "fxp/composer-asset-plugin:^1.2.0" composer create-project --prefer-dist yiisoft/yii2-app-basic basic
then run the following command to install Yii2 with basic template.
composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic
To install Yii2 with advanced template run
composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced advanced cd advanced php init
After that create a new database and adjust the components['db'] configuration in common/config/main-local.php accordingly. then run the following command to
php yii migrate
Download the archive file from Yii-download
Unpack the downloaded file to a Web-accessible folder.
Modify the config/web.php file by entering a secret key for the cookieValidationKey configuration item
You can add any type of key you want:
'cookieValidationKey' => '', For example : xyctuyvibonp 'cookieValidationKey' => 'xyctuyvibonp',
//insert a secret key in the following (if it is empty) - this is required by cookie validation 'cookieValidationKey' => 'enter your secret key here',