Home  >  Article  >  Backend Development  >  Installation and setting of global variables of composer under windows

Installation and setting of global variables of composer under windows

王林
王林forward
2019-08-20 16:33:023836browse

Composer is a tool used by PHP to manage dependency relationships. You can declare the external libraries (libraries) you depend on in your project, and Composer will install these dependent library files for you.

1. Use the installer

to download and fool-proof installation: Composer-Setup.exe

2. Manual installation

2.1 Change directory and download composer.phar

Enter dos command:

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

Installation and setting of global variables of composer under windows

2.2 Move composer.phar

If the directory you downloaded is not in php, please move it to php

Installation and setting of global variables of composer under windows

3. Set global variables

3.1 Create a new composer.bat

##composer.bat and composer.phar are in In the same folder, and don’t enter anything

Installation and setting of global variables of composer under windows

3.2关键步骤

输入命令:

echo @php "%~dp0composer.phar" %*>composer.bat

Installation and setting of global variables of composer under windows

3.3测试

在随意目录下输入:

composer -v

Installation and setting of global variables of composer under windows

更多PHP相关问题请访问PHP中文网:https://www.php.cn/

The above is the detailed content of Installation and setting of global variables of composer under windows. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete