How to install composer


Mar 02, 2016    Janaki Mahapatra, Laravel

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. Windows Installer The installer will download composer for you and set up your PATH environment variable so you can simply call composer from any directory. Download and run Composer-Setup.exe - it will install the latest composer version whenever it is executed. Command-line installation Run this in your terminal to get the latest Composer version:
php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php
php -r "if (hash('SHA384', file_get_contents('composer-setup.php')) === 'fd26ce67e3b237fffd5e5544b45b0d92c41a4afe3e3f778e942e43ce6be197b9cdc7c251dcde6e2a52297ea269370680') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); }"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer