Installation
suggest changeYou may install Composer locally, as part of your project, or globally as a system-wide executable.
Locally
To install, run these commands in your terminal.
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
Compare the installer's SHA-384 with the hash published at https://composer.github.io/pubkeys.html before running php composer-setup.php. The commands above do not do that check.
This will download composer.phar (a PHP Archive file) to the current directory. Now you can run php composer.phar to use Composer, e.g.
php composer.phar install
Globally
To use Composer globally, put composer.phar in a directory that is part of your PATH:
mv composer.phar /usr/local/bin/composer
Now you can use composer anywhere instead of php composer.phar, e.g.
composer install
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents