Now-a-days, many modern php frameworks like laravel, symfony, codeigniter and other libraries use the composer to manage their dependencies. So you need composer to install them on your machine. In case you don't know, Composer is the tool for dependency management in php. It allows you to declare the dependency libraries and packages required for a project and it will install, update and manage them for you. Composer will never maintain anything globally by default but rather on per-project basis.
You need PHP 5.3.2 and above to use Composer. So make sure the system requirements are met before installing it on your machine. In addition, you must also make some changes to the php settings to make it work.
Change Settings on php.ini:
I hope you have XAMPP installed already on your machine. So before composer installation, do the following changes on your php.ini file.
Go to [path-to-xampp]/php folder and open php.ini file.
Locate the below lines one by one and remove the semicolon (;) from the start.
extension=php_openssl.dll
extension=php_curl.dll
extension=php_sockets.dll
Save the file.
Install Composer on Windows:
STEP-1) First download composer for windows and click on the exe file. This will launch the setup for installing composer on your system. Click 'Next'.
STEP-2) Next you need to select the path to the php executable file. Just click on the 'Browse' button and select 'php.exe' file. It can be found inside [path-to-xampp]/php folder. Click 'Next'.
STEP-3) Now a window appears for proxy settings. Just leave it blank for now and click on 'Next' button.
STEP-4) Finally the ready to install window pops up. Click on 'Install' to start installing the tool.
Done! Once you finished installing composer, you can check it via command line.
Click on 'Start' > 'Run' dialogue, type cmd
and click 'OK'.
On the command prompt, simply type composer
and hit enter. If composer is successfully installed on your windows machine, you will see the below screen.
Restart your machine and launch 'XAMPP' control panel and start using composer. The same procedure can be used to install composer for 'WAMP' stack or even if you have installed php separately.
Read Also: