Home >Backend Development >PHP Tutorial >composer dependency management tool
Composer is PHP A dependency management tool,It is managed on a per-project basis and installed in a certain directory of your project (such as vendor).
By default it will not install anything globally. So this is just a dependency management.
Composer
will solve the problem for you like this:
a)
You have a project that depends on several libraries.
b)
Some of these libraries depend on other libraries.
c)
You declare what you rely on.
d) Composer will find out which versions of packages need to be installed, and install them (download them into your project).
Composer requires PHP version 5.3.2 or above.
Before installing composer, you have to make sure that PHP has been added to the system's Path environment variable. The detection method
Enter php in cmd - v
If not, please copy the file directory containing php.exe to the path
composer installation. Here we only talk about the manual installation process:
1: Go to the composer official website to download the latest version of composer
https://getcomposer.org/download/
After downloading, it will be a composer.phar file, then copy it to the PHP installation directory (the same directory as PHP.exe), and command The PHP executed in should be the same set of PHP, then create a new composer.bat file here, and save the following code to the file
<code>@php <span>"%~dp0composer.phar"</span> %*</code>Finally, reopen a command line window and try to execute it
to see if the version is output correctly Number. composer --version
This method corresponds to global installation and can be run with the composer command anywhere. For partial installation, you need to copy composer.phar to the place where you want to run it and run it through php composer.phar.