2.8.4.4.1. Installing Yii 2
Attention!
During installation, the following text will be displayed in the console on a yellow background:Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
This is not a bug, just a notification that an old version of Composer is being used.
- Connect to hosting via SSH.
- Install Composer version 1.x (Yii 2 does not support Composer 2.x).
- Go to your site directory:
cd ~/example.com
- Install Composer Asset Plugin (manages bower and npm package dependencies):
composer global require "fxp/composer-asset-plugin:^1.4.6"
- Install Yii 2 and set up the root directory:
- To install the Yii 2 Basic Application Template, run the command:
composer create-project yiisoft/yii2-app-basic www
Instead
www
specify the path to the subdirectory where the framework is installed.
- To install the Yii 2 Advanced Application Template, run the commands:
composer create-project yiisoft/yii2-app-advanced www php www/init
In each of the teams, instead of
www
specify the path to the subdirectory where the framework is installed.
- Wait a few minutes and check if the site is working.