YII2 uses Composer to install yii2composer

Source: Internet
Author: User

YII2 uses Composer to install yii2composer
YII2 is reposted at 17:24:12, January 1, March 30, 2016 through the Composer Installation Method

  • 2107
YII2 installation through Composer
Http://www.yiichina.com/download


1. Install Composer
First to begin
Then install composer_setup.exe.



Ii. Create composer. phar


2. download the following file to r:/php_phar in a browser named "composer_installer.phar ":
Https://getcomposer.org/installer
3. Open the cmd command line and switch to the composer installation directory:
Cd r:/php_phar
You can also go to r:/php_phar through my computer, press shift, right-click, and select "Open command window here"
2_windows_explorer_shift_to_cmd
4. Run the following command to install the SDK:
Php composer_installer.phar
3_php_composer_installer
5. Run "php r:/php_phar/composer. phar-V". if the version number is displayed, the installation is successful. You can run other functions of composer in other directories through "php r:/php_phar/composer. phar other command line parameters.
4_php_composer_check_is_ OK
------------
Q: I can directly enter "composer xxx" in the windows Command Line in the official manual or other tutorials. How can I do this?
A: You need to add the bat file and modify the PATH environment variable.
1. Add a bat file.
Add composer. bat in the composer installation directory. The file content is:
@ Echo off php % ~ Dp0composer. phar % *
In this way, you can run composer directly through bat:
R:/php_phar/composer-V
4_bat_php_composer_check_is_ OK
2. Add r:/php_phar to the path environment variable and restart the command line to achieve the following results:




Iii. Install YII2
After installing Composer, run the following command to install the Composer Asset plug-in:


Php composer. phar global require "fxp/composer-asset-plugin :~ 1.1.1"
Select one of the application templates to install Yii 2.0. An Application Template is a skeleton Web application package containing Yii.


Install the basic application template and run the following command:
Php composer. phar create-project yiiso ft/yii2-app-basic basic 2.0.7
Install the Advanced Application Template and run the following command:
Php composer. phar create-project yiisoft/yii2-app-advanced advanced 2.0.7
Please note that you may be prompted to enter your GitHub user name and password during installation. This is normal. Just enter them and continue View comments

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.