Installing Composer with XAMPP on Windows

composer

From getcomposer.org, Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.

Composer is not a package manager. Yes, it deals with “packages” or libraries, but it manages them on a per-project basis, installing them in a directory (e.g. vendor) inside your project. By default it will never install anything globally. Thus, it is a dependency manager.

By default, the installation sometimes fails due to differences of PHP configuration in php.ini file. This tutorial will explain how to install Composer with XAMPP runs on Microsoft Windows.

1. Open php.ini file E:\xampp\php\php.ini with your favorite text editor and make sure these modules are enable by removing the semicolon (;)

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

2. Still in php.ini file, find extension_dir and browscap

extension_dir = "\xampp\php\ext"
browscap = "\xampp\php\extras\browscap.ini"

In this case, the XAMPP is installed in drive E. Change this your own installed drive.

extension_dir = "E:\xampp\php\ext"
browscap = "E:\xampp\php\extras\browscap.ini"

3. Download Composer for Windows https://getcomposer.org/Composer-Setup.exe and install.

4. Install Composer into the same directory php.exe is located, usually “\xampp\php\php.exe”

Done. Good luck!

12 comments on “Installing Composer with XAMPP on Windows

  1. I check all of you said but not solve,I did some search and fine below solution if your solution not work for somebody

    Ensure that the SSL certs are installed and found by PHP.

    In `php.ini`:

    curl.cainfo=/path/to/ssl-certs/ca-bundle.crt
    openssl.cafile=/path/to/ssl-certs/ca-bundle.crt

    If certs are missing: download a cert bundle from http://curl.haxx.se/ca/cacert.pem and save as `ca-bundle.crt`.

    (Or simply use a server stack for Windows, which ships Composer right out-of-the-box: [WPN-XM](http://wpn-xm.org/))

  2. The problem with me was only with windows installer, I was able to install it correctly using CLI, although I guess it was not working properly. I was getting some errors when trying to start a new laravel project.

  3. Hey,
    The issue beside me had been just along with home windows specialist, We could do the installation properly utilizing CLI, even though I suppose it had been no longer working correctly. We had been benefiting from mistakes whenever attempting to begin a brand new la-ravel task.
    Thanks.

  4. Thanks alot who ever you may be . This article helped me so much in solving hours of brain racking and tireless unistalling and reinstalling . Keep up the good work I appreciate it.

  5. I have an error while installing composer- php_propro.dll missing and php_http.dll not found. That dll files are present in xampp/php/ext folder. I dont know what is error.

Create Comment

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