gremo gremo - 11 months ago 32
PHP Question

Is there any way to install Composer globally on Windows?

I've read the global installation documentation for Composer, but it's for *nix systems only:

curl -s | php
sudo mv composer.phar /usr/local/bin/composer

I would be such happy doing the same on Windows, that's the OS of my development machine. I would be able to run

composer update

From an arbitrary folder where
exists. Interpreter
is already in

Any clue?


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:

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!