Home > Article > Development Tools > Detailed description of windows installation composer
The following column will introduce you to the windows installation composer tutorialcomposer , I hope it will be helpful to friends in need!
1.
Ensure that the php environment variable has been set, and the variable address is the directory where php.exe is located
Run php -v OK Return to php version
2.
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" php composer-setup.php php -r "unlink('composer-setup.php');"
Execute the first command to download the composer-setup.php
script that will simply detect php.ini
Parameter settings in, if some parameters are not set correctly, a warning will be given; then download the latest version of the composer.phar
file to the current directory.
The functions of the above three commands are:
1. Download the installation script - composer-setup.php
- to the current directory.
2. Execute the installation process.
3. Delete the installation script.
3.
1. Find and enter the PHP installation directory (the php
command you executed on the command line should is the same set of PHP).
2. Copy composer.phar
to the PHP installation directory, which is the same level directory as php.exe
.
3. Create a new composer.bat
file in the PHP installation directory and save the following code into this file.
4.@php "%~dp0composer.phar" %*
Finally reopen a command line window and try to execute composer - -version
Check whether the version number is correctly output.
四、
composer config -g repo.packagist composer https://packagist.phpcomposer.com
The above is the detailed content of Detailed description of windows installation composer. For more information, please follow other related articles on the PHP Chinese website!