php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');" ----
Change to a directory on your PATH
and run the installer following the Download page instructions to download composer.phar
.
Create a new composer.bat
file alongside composer.phar
:
C:\bin>echo @php "%~dp0composer.phar" %*>composer.bat
Add the directory to your PATH environment variable if it isn’t already. For information on changing your PATH variable, please see this article and/or use Google.
Close your current terminal. Test usage with a new terminal:
C:\Users\username>composer -V
Composer version 1.0.0 2016-01-10 20:34:53