Home  >  Article  >  Backend Development  >  How to install Yii framework using Composer

How to install Yii framework using Composer

WBOY
WBOYOriginal
2016-07-29 08:58:371192browse

The example in this article describes how to install the Yii framework using Composer. Share it with everyone for your reference, as follows:

It is now popular to use Composer to install PHP frameworks. Composer is a tool used by PHP to manage dependencies. Frameworks or services such as Yii, Laravel, Qiniu, etc. all use Composer as the preferred tool for installation.

The following is an example of downloading and installing the Yii framework to learn how to 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 to install Yii2.0. If you don't have Composer installed yet, you can follow the instructions here to install it.

After installing Composer, run the following command to install the Composer Asset plug-in:

Copy the code The code is as follows:

php composer.phar global require "fxp/composer-asset-plugin:1.0.0"


Now select one of the application templates to start installing Yii 2.0. An application template is a package containing a skeleton web application written in Yii.

Install the basic application template, run the following command:

Copy the code The code is as follows:

php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.4


Install Advanced application template, run the following command:

Copy the code The code is as follows:

php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.4


Please note that you 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 http://www.tantengvip.com/2015/05/composer-php/

Readers who are interested in more Yii-related content can check out this site’s special topic: "Getting Started with Yii Framework and Common Techniques" Summary", "Summary of PHP Excellent Development Framework", "Basic Tutorial for Getting Started with Smarty Templates", "Summary of PHP Date and Time Usage", "Introduction Tutorial on PHP Object-Oriented Programming", "Summary of PHP String Usage", " php+mysql database operation introductory tutorial" and "php common database operation skills summary"

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

The above introduces the method of using Composer to install the Yii framework, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]