First we need to install composer. Steps to install composer Install Composer.
curl -sS https://getcomposer.org/installer | php
Now change directory:
sudo mv composer.phar /usr/local/bin/composer
Check composer working
composer
Now Composer installed.
There two ways to install Yii2 advance.
1.Installing from an Archive File
Get zip file from below link.
Unzip it into destination directory, e.g. /var/www/html
.
https://github.com/yiisoft/yii2/releases/download/2.0.8/yii-advanced-app-2.0.8.tgz
Move inside the "advanced" folder. Move manually or type below command.
cd advanced
Run below command.
php init
2.Installing via Composer
Installing via composer require github authentication token. For token you need to sign up on GitHub.
After signup you can generate your token :
Steps to generate a token
Reference : https://help.github.com/articles/creating-an-access-token-for-command-line-use/
After Generating token copy it
Change directory
cd /var/www/html/
Run below command
composer config -g github-oauth.github.com <AuthToken>
example:
composer config -g github-oauth.github.com f1eefb8f188c22dd6467f1883cb2615c194d1ce1
Install yii2
composer create-project --prefer-dist yiisoft/yii2-app-advanced advanced
Move inside the "advanced" folder. Move manually or type below command.
cd advanced
Run below command.
php init
Its done!
Now you can check it.
http://localhost/advanced/frontend/web
and
http://localhost/advanced/backend/web