1. Download Composer_installer.phar
Https://getcomposer.org/composer.phar
Rename to Composer_installer.phar
Put the file in the root directory www
2. Open the OpenSSL extension for PHP
Open the corresponding PHP version of Php,ini
Remove annotations;
3. Installing composer
CMD, D: CD d:/phpstudy/www
PHP Composer_installer.phar
4. Set non-global variables but you can use the composer command directly
Under c:/, create the Initcmdenv.cmd file content as follows
@echo off:: Temporary system path (add additional path for the current command line, can be arbitrarily increased without affecting the global system) set path=%path%;:: Commands (Add new Shortcut command, must be doskey shortcut name = Full command) DOSKEY composer=php D:/phpstudy/www/composer.phar $*::show Something (display initialized content, can be deleted) echo ========doskey======== ==doskey/macrosecho ========end==========
Create a C:\Windows\System32\cmd.exe shortcut
Set Kaixie mode target to%windir%/system32/cmd.exe/k c:/initcmdenv.cmd
Once set up, run the Cmd.exe shortcut directly to use the composer command directly from anywhere on the command line.
5. Download the composer archive package
2 versions, advanced and basic:
Https://github.com/yiisoft/yii2/releases/download/2.0.9/yii-advanced-app-2.0.9.tgz
Https://github.com/yiisoft/yii2/releases/download/2.0.9/yii-basic-app-2.0.9.tgz
Download and unzip to the root directory WWW
Add a Chinese mirror address to the extracted archive package Composer.json
{" repositories": {" packagist": {" type": "Composer", "url": "Https://packagist.phpcomposer.com" } } }
6. Require "fxp/composer-asset-plugin:~1.1.1" query and add the latest version
Or
Composer global require "fxp/composer-asset-plugin:~1.1.1"
7. Create a YII2 project
CMD, D: cd D:/phpstudy/www/baisc (adcanced)
Advanced
Composer Create-project--prefer-dist--stability=dev yiisoft/yii2-app-advanced. /yii2test
Basic
Composer Create-project--prefer-dist--stability=dev yiisoft/yii2-app-basic. /yii2test
8.Token (GitHub)
Create a new Token
Https://github.com
Myid:[email protected]**.com password:23*********
⑴
⑵
⑶
⑷
⑸
⑹
You will get the token input.
Composer Yii2 Non-global variable archive installation Win7