Download, Install and Config Composer

March 9, 2018 - Composer, Information Technology

1. Download and run the installer


To quickly install Composer in the current directory, run the following script in your terminal.

php -r “copy(‘’, ‘composer-setup.php’);”
php -r “if (hash_file(‘SHA384’, ‘composer-setup.php’) === ‘544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061’) { echo ‘Installer verified’; } else { echo ‘Installer corrupt’; unlink(‘composer-setup.php’); } echo PHP_EOL;”
php composer-setup.php
php -r “unlink(‘composer-setup.php’);”

This installer script will simply check some php.ini settings, warn you if they are set incorrectly, and then download the latest composer.phar in the current directory. The 4 lines above will, in order:

      • Download the installer to the current directory
      • Verify the installer SHA-384 which you can also cross-check here
      • Run the installer
      • Remove the installer

2. Move the Composer to make it global


Run the command:

mv composer.phar /usr/local/bin/composer

Leave a Reply

Your email address will not be published. Required fields are marked *