Download Composer
Run this in your terminal or command prompt to get the latest Composer version :
curl -s https://getcomposer.org/installer | php --
or
curl -sS https://getcomposer.org/installer | php
or if you don't have curl :
php -r "readfile('https://getcomposer.org/installer');" | php
After downloading the composer file execute the below command for downloading libraries.
For update the composer file
php composer.phar self-update
For downloading the libraries
php composer.phar update (or install)
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
Installer Options
--install-dir
You can install composer to a specific directory by using the --install-dir
option and providing a target directory. Options must be appended to --
so that PHP ignores them, like -- --install-dir=bin
, example :
curl -sS https://getcomposer.org/installer | php -- --install-dir=bin
--filename
You can specify the filename (default: composer.phar) using the --filename
option. example :
curl -sS https://getcomposer.org/installer | php -- --filename=composer
--version
You can install composer to a specific release by using the --version
option and providing a target release. example :
curl -sS https://getcomposer.org/installer | php -- --version=1.0.0-alpha8
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.