1, if not installed Composer, then enter the following command in the terminal, first install Composer (wait a bit long, please be patient, the same as below):
| 12 |
#若复制到终端里运行不了,请手工输入(下同)curl -sS https://getcomposer.org/installer | php |
2. Run the following command to install the Composer asset plugin:
| 1 |
php composer.phar global require "fxp/composer-asset-plugin:1.0.0-beta3" |
An error may occur that throws the following exception:
Description Composer.phar file is wrong, download Composer.phar from Https://getcomposer.org/composer.phar, overwrite Composer.phar in current directory. Then re-execute step 2. The occurrence of this procedure indicates that this step has been successfully performed.
3, the above related composer environment installation is complete, select one of the application templates below, and start installing Yii2.0. An application template is a Web application package that contains the basic structure of yii.
To install the basic Application template, run the following command:
| 1 |
php composer.phar create-project yiisoft/yii2-app-basic /var/www/yii-test |
To install the Advanced application template, run the following command:
| 1 |
php composer.phar create-project yiisoft/yii2-app-advanced /var/www/yii-test |
The above command means to install the YII2.0 framework package into the "/var/www/yii-test" directory.
During the installation process, the following error may occur:
By editing the "Disable_functions" in the php.ini, the function in the prompt is removed and disabled to resolve.
The following account entry prompts appear during the installation process:
Enter your github account and password, and then wait for the installation to complete.
4. Then execute the "init" file under the current directory, such as:
0 and 1 Select one (0 for the development environment, 1 for the test environment), after the carriage return, the installation succeeds.
5, through the browser into the "http://localhost/frontend/web/index.php", appears as shown, the installation is successful.
Install Yii2.0 under Linux