SoFunction
Updated on 2025-03-10

How to install Yii framework using Composer

This article describes how to install the Yii framework using Composer. Share it for your reference, as follows:

Popular nowComposerInstall the PHP framework. Composer is a tool used by PHP to manage dependencies. Yii, Laravel, Qiniu and other frameworks or services use Composer as the preferred tool for installation.

Here is a case where you can use Composer to install the PHP framework:

First, go to Composer to download and install this tool.

Install Yii via Composer

This is the preferred method for installing Yii2.0. If you haven't installed Composer yet, you can follow the instructions here to install it.

After installing Composer, run the following command to install the Composer Asset plugin:

Copy the codeThe code is as follows:
php global require "fxp/composer-asset-plugin:1.0.0"

Now select one of the application templates and start installing Yii 2.0. Application template is a skeleton web application package containing Yii writes.

Install the basic application template and run the following command:

Copy the codeThe code is as follows:
php create-project yiisoft/yii2-app-basic basic 2.0.4

Install the advanced application template and run the following command:

Copy the codeThe code is as follows:
php create-project yiisoft/yii2-app-advanced advanced 2.0.4

Please note that you may be prompted to enter your GitHub username and password during the installation process. This is normal. Just enter them and continue.

Reprinted from: Xiaotan Blog /2015/05/composer-php/

For more information about Yii, readers who are interested in this site can view the topic:Yii framework introduction and common techniques summary》、《Summary of excellent development framework for php》、《Basic tutorial on getting started with smarty templates》、《Summary of the usage of php date and time》、《PHP object-oriented programming tutorial》、《Summary of usage of php strings》、《PHP+mysql database operation tutorial"and"Summary of common database operation techniques for php

I hope that this article will be helpful to everyone's PHP programming based on the Yii framework.