Use Composer to install the Yii framework.
This example describes how to install the Yii framework using Composer. We will share this with you for your reference. The details are as follows:
Currently, Composer is widely used to install the PHP framework. Composer is a tool used by PHP to manage dependencies. Frameworks and services such as Yii, Laravel, and qiniu use Composer as the preferred tool for installation.
The following uses downloading and installing the Yii framework as an example to learn how to use Composer to install the PHP framework:
First go to Composer to download and install this tool.
Install Yii through Composer
This is the preferred method for installing Yii2.0. If you have not installed Composer, follow the instructions here to install it.
After installing Composer, run the following command to install the Composer Asset plug-in:
Copy codeThe Code is as follows: php composer. phar global require "fxp/composer-asset-plugin: 1.0.0"
Select one of the application templates to install Yii 2.0. An Application Template is a skeleton Web application package containing Yii.
Install the basic application template and run the following command:
Copy codeThe Code is as follows: php composer. phar create-project yiisoft/yii2-app-basic basic 2.0.4
Install the Advanced Application Template and run the following command:
Copy codeThe Code is as follows: php composer. phar create-project yiisoft/yii2-app-advanced advanced 2.0.4
Please note that you may be prompted to enter your GitHub user name and password during installation. This is normal. Just enter them and continue.