I\'ve read the global installation documentation for Composer, but it\'s for *nix systems only:
curl -s https://ge
sorry to dig this up, I just want to share my idea, the easy way for me is to rename composer.phar to composer.bat and put it into my PATH.
Unfortunately, all the good answers here didn't work for me. So after installing composer on windows 10, I just had to set system variable in environment variables and it worked.
you can install it using this command line
echo @php "%~dp0composer.phar" %* > composer.bat
An alternative variant (see Lusitanian answer) is to register .phar files as executable on your system, exemplary phar.reg file:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.phar]
@="phar_auto_file"
[HKEY_CLASSES_ROOT\phar_auto_file\shell\open\command]
@="\"c:\\PROGRA~1\\php\\php.exe\" \"%1\" %*"
Just replace the path to php.exe to your PHP executable. You can then also extend the %PATHEXT% commandline variable with .PHAR which will allow you to type composer instead of composer.phar as long as composer.phar is inside the %Path%.
Sure. Just put composer.phar somewhere like C:\php\composer.phar, then make a batch file somewhere within the PATH called composer.bat which does the following:
@ECHO OFF
php "%~dp0composer.phar" %*
The "%*" repeats all of the arguments passed to the shell script.
Then you can run around doing composer update all ya want!
A bit more generic if you put the batch in the same folder as composer.phar:
@ECHO OFF
SET SUBDIR=%~dp0
php %SUBDIR%/composer.phar %*
I'd write it as a comment, but code isn't avail there