The Yii2.0 program can be installed using Composer. You only need to execute a simple command to install new extensions or update Yii. Below, we will take a look at the specific installation methods and steps.
How to install the yii2.0 program?
(1) Install Composer
If you haven’t installed Composer yet, you can read this tutorial: How to install composer?
Recommended learning: yii tutorial
(2) Update Composer to the latest version
If you have already installed Composer please Make sure you are using the latest version. You can use the composer self-update command to update Composer to the latest version.
Note: During Yii installation, Composer needs to request a lot of information from the Github API. The number of requests depends on what your application depends on and may be greater than the Github API rate limit. If this limit is reached, Composer may ask you to provide your Github login credentials to obtain a Github API access token.
(3) Install Yii application template
After installing Composer, you can install Yii by running the following command under a web-accessible folder Application Template:
composer create-project --prefer-dist yiisoft/yii2-app-basic basic
This will install the latest stable version of the Yii application template in a directory called basic . You can choose a different directory name if needed.
If you want to install the latest version of Yii, you can use the following command
composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic
Please note that the development version of Yii should not be used in production as it may Break your running code.
The above is the detailed content of How to install the yii2.0 program?. For more information, please follow other related articles on the PHP Chinese website!