How to run composer from anywhere?

You can do a global installation (archived guide): Since Composer works with the current working directory it is possible to install it in a system-wide way. Change into a directory in your path like cd /usr/local/bin Get Composer curl -sS https://getcomposer.org/installer | php Make the phar executable chmod a+x composer.phar Change into a project directory … Read more

Get the list of outdated Composer packages

Update: Since Composer v1.1 (May 2016) the following commands are available: composer outdated shows you the list of outdated packages composer show -l returns the complete list of packages. packages in need of update are colored red. the (still) up-2-date ones are colored green. both commands accept the parameter –direct to show only direct dependencies … Read more

How to change PHP version used by composer

You can change php version of composer without uninstalling it, follow these steps : Search for system environment variables in cortana. Click on the button “Environment variables”. Under “System variables” select path and click on edit, you will see one entry like this “C:\wamp\bin\php\php5.6.13”. Just change this to the folder name of the php located … Read more

Unable to self-update Composer

As Waqleh said, you have to uninstall PHP Composer and install it again. First, execute: sudo apt-get remove composer Then, execute these commands. The checksum here is for Composer 1.10.13, but you’ll get the newest Composer (2.0.4 at the moment of editing this answer) when running the first line, so be sure to check in … Read more

Where to find composer’s global packages?

You can query Composer to find where it has set the user $COMPOSER_HOME directory. composer config –list –global The [home] … line refers to the default value of $COMPOSER_HOME. The word home can be used as a single parameter as well to show the configuration value. Example (Windows): > composer -n config –global home C:\Users\<user>\AppData\Roaming\Composer … Read more

Running composer in a different directory than current

Try composer install -h. There you’ll find an option –working-dir (or -d). And that’s what you’re looking for. Then run: composer install –working-dir=/home/someuser/myproject You can find more in composer docs. Depending on your operating system, the = might need to be removed: composer install –working-dir /home/someuser/myproject