Composer is not a package manager. Yes, it involves "packages" and "libraries", but it is managed on a per-project basis and installed in a directory of your project (for example vendor
). By default it will not install anything globally. Therefore, this is only a dependency management.
Composer will solve this problem for you:
A) You have a project that relies on a number of libraries.
b) Some of these libraries depend on other libraries.
c) You declare what you depend on.
d) Composer will find out which version of the package needs to be installed and install them (download them to your project).
Setting PHP Environment variables
Environment variables Even if the method is effective
Enter DOS input
Set
Close the DOS window. Open the DOS window again
Echo%PATH%
Download the installation file
Command Line Input
" ReadFile (' Https://getcomposer.org/installer '); " > composer-setup.php
Note: If you receive a ReadFile error message, use the http
link or turn on Php_openssl.dll in php.ini.
Which directory the DOS command line is pointing to and which directory the files will be downloaded to
Perform
PHP composer-setup.php
Download down a Composer.phar file
will be composer.phar
copied to PHP under the installation directory, that is, and php.exe
in the same level directory.
Create a new file in the PHP installation directory composer.bat
and save the following code to this file.
" %~dp0composer.phar " %*
Finally reopen a command-line window and try it out to composer --version
see if the version number is correctly printed.
Install composer under Windows