Last Updated: February 25, 2016
· markushausammann

Using composer to manage global packages

It's possible to use composer to manage global packages the way PEAR functions. Most often you don't want that but it can be helpful for QA packages like phploc, etc.

In the following example we install phing globally in a shell script:


# Install composer and add it to the system path
curl -sS | php 
mv composer.phar /usr/local/bin/composer

# Install Phing globally with Composer
composer global require phing/phing:2.6.1

This will install phing to the $COMPOSER_HOME directory, which is by default:


Therefore, if you want phing and other PHP executables to be globally available, add:


to your system path. If you want to change the location of the composer home, you can do that by setting the COMPOSER_HOME var before installing the package:

composer global require phing/phing:2.6.1
Say Thanks
Filed Under