For Yii 2 you should have a version of PHP 5.4 or higher.

Preparing for installation of Yii 2 basic

The next steps are done one time, before the first installation of the project on Yii 2.

If you first install the project on Yii 2, then first you need to create a token on github. How to do this is described here кодер.укр/записи/yii-framework-2-как-я-устанавливал-yii2 (in Russian, everything is clear from the images) At the beginning of the article, after adding the token, go back.

Next, execute the command in the console:

composer global require "fxp/composer-asset-plugin:~1.0.3"

Installing Yii 2 basic

1. Open the console and go to the project folder:

cd domains

2. Then execute the command:

composer create-project --prefer-dist yiisoft/yii2-app-basic my-project-name.local

Where my-project-name.local is the folder where you want to install Yii 2 basic.

3. Create a database in phpMyAdmin, open the file /my-project-name.local/config/db.php and configure the connection to the database:

<?php
return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=localhost;dbname=yii2_basic_db',
    'username' => 'root',
    'password' => '',
    'charset' => 'utf8',
];

Done, yii 2 basic is ready for work. Project is available by URL: my-project-name.local/web

Additionally

How to remove a "web" from the URL can be read here: .htaccess for Yii 2 basic