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

Installation and setting of global variables of composer under windows

王林
Release: 2023-02-23 10:16:01
forward
3956 people have browsed it

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
Copy after login

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
Copy after login

Installation and setting of global variables of composer under windows

3.3测试

在随意目录下输入:

composer -v
Copy after login

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!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Composer failed to install TP51
From 1970-01-01 08:00:00
0
0
0
PHP study installation composer cannot be used
From 1970-01-01 08:00:00
0
0
0
php - Error using composer
From 1970-01-01 08:00:00
0
0
0
ThinkPHP Why use composer?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template