Elizabeth
Engineer
Engineer
  • UID625
  • Fans1
  • Follows1
  • Posts68
Reads:750Replies:0

Install plug-ins in Yii2.0

Created#
More Posted time:Nov 8, 2016 16:49 PM
Install Yii2.0:
Precondition: Important: Your PHP version must be of PHP5.4 or above.
1. First, download the application template which comprises basic templates and advanced templates. Here I take the advanced templates for example:
Download the advanced application templates from here: https://github.com/yiisoft/yii2-app-advanced
2. Unzip the downloaded templates to the www directory. I put them to D:\wamp\www\yii2\advanced.
Run the cmd dos command to access the directory D:\wamp\www\yii2\advanced:


3. Run the php -r "readfile('https://getcomposer.org/installer');" | php


4. Now a composer.phar file is downloaded to the D:\wamp\www\yii2\advanced directory. With the file, we can execute the php composer.phar command. The prompt is shown as follows:


5. Prepare all the plug-ins. Important: This step is crucial for the success of the entire operation (Do remember to configure the PHP environment variables).
Run commands: php composer.phar global require "fxp/composer-asset-plugin:1.0.0"
6. Install the Yii2.0 application:
Run commands: php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced ../yii2test, and the yii2test application will be generated in the directory of the upper level.
Note: The process may be stuck at Step 6. In this case, log in to the GitHub with the user name and password. If you don't have an account yet, register one. Then exit cmd, and re-start Step 6.
If it prompted you to input your GitHub user name and password during the installation process, input them and continue. Now it may be requesting the input of a token.


7. The last step: Initialize our application. The initialization is implemented by running the cmd init command in the yii2test directory you created, and select 0 y.


Okay. Now our Yii2.0 application has been installed. Enter the test directory:
localhost/yii2/yii2test/frontend/web/index.php
You will see the following interface:
Guest