Composer Installation in Windows

Composer is a dependency management  tool used for PHP. This tool will help to declare the dependent libraries required for a project and will install them in the project. This means that Composer will pull in all the required libraries, dependencies and manage them all in a project. Composer is multi-platform, runs equally well on Windows, Linux and OSX.

Minimum Requirements : 

Composer requires PHP 5.3.2+ version to run.
A few sensitive php settings and compile flags are also required, but the installer will warn you about any incompatibilities.

Composer installation in windows environment :

Composer installation in windows can be accomplished in two ways

1) Using installer :

a) Download Composer-Setup.exe from the link https://getcomposer.org/Composer-Setup.exe
b) Run the downloaded setup file.
c) Added the composer path in Environment Variables.

2) Manual installation :

a) Open the command line prompt.
b) Create a directory named “bin” in the drive where Windows is installed ( Can create directory any where)
c) Change the path to the newly created directory in Command line.
d) run the install snippet (php -r “eval(‘?>’.file_get_contents(‘https://getcomposer.org/installer’));)to download composer.phar

Example :
Considering Windows is installed in C drive

C:\Users\username>mkdir bin
C:\Users\username>cd C:\bin
C:\bin>php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"

 

Note : If fails to install change https to http in file_get_contents function or enable php_openssl.dll in php.ini

Installation Check :

In command line run the command “composer -V” and if you get the version, installation is success

C:\Users\username>composer -V
Composer version 29gtfes012544