How to install Composer on Windows with XAMPP

Composer is one of the best and most powerful package manager for PHP. With the help of composer user can easily manage their libraries or packages in a per-project basis. But by default composer will never install anything globally.

Also read:

 

Before doing anything else you need to download and install XAMPP. If you don’t know how to install XAMPP on windows machine you can check my previous posts.

Before we start installation, we need to open php.ini file which is located in xampp/php/php.ini. Then find following lines one by one and remove semicolon (;) from the start.

extension=php_openssl.dll,
extension=php_curl.dll,
extension=php_sockets.dll

After above changes we are ready for Composer Installation.


Install Composer on Windows Machine with XAMPP

First of all you need to download Composer-Setup.exe file from getcomposer.org/download page. Once file downloaded click on it. After click on file, some permission window will open; feel free to click YES on that pop up. After that, Composer setup starts. Click on the next button as given below in the image.

Composer Setup Start on Windows

After click on next. Settings Check window will appear here you add your php.exe path which is located in your XAMPP directory in PHP folder (xampp/php.exe).

wdb24_composer_setup

wdb24_php_exe

 

wdb24_php_exe_path

After selecting php.exe click on next. It will then go to Proxy Settings.  Here you can add proxy URL. Just click on next button because right now you don’t need to use proxy.

Composer Installation Proxy Setting in Windows

Next is ready to install window. Just click on Install button and installation will start.

composer ready to install on windows

After installation, Information window will open in which you need to close and open command line and file explorer but my recommendation is restart your Computer. Done

 

Posted in PHP

6 Replies to “How to install Composer on Windows with XAMPP”

  1. I ma getting the following error, while reaching to last step:

    The “https://getcomposer.org/versions” file could not be downloaded: php_network_getaddresses: getaddrinfo failed: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.

  2. I am getting following error..
    The “https://getcomposer.org/versions” file could not be downloaded: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

  3. it worked here.
    the only thing the line extension=php_openssl.dll needed the semicolon (;) in my setup

  4. Hi, i can’t seem to install composer, it always pop up a message that “php4ts.dll is missing”

Leave a Reply

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