Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install Composer on Windows 10

Install PHP, then use the Composer-Setup installer to add Composer to your PATH.

Windows Hosting2 min read7 steps11 screenshots

Requirements

You need PHP on your computer. Check:

php -v
Checking the PHP version

If PHP is not installed, install it first (for example with XAMPP, or by unzipping PHP from windows.php.net and adding its folder to the PATH). Check again after the install.

PHP is installed

Download Composer

Go to the Composer website and download Composer-Setup.exe.

Downloading Composer-Setup.exe

Run the installer

  1. Choose the install mode. Install for all users (needs admin rights) is the usual choice. Developer mode installs Composer in a way that lets you edit its files; it is for people who work on Composer itself.
    Choosing the installation option
  2. Choose the install path for Composer.
    The installation path
  3. Choose the PHP executable. Point the installer to your php.exe. If PHP is in the PATH, it finds it by itself. The installer may warn you about settings in php.ini, such as the openssl extension. Fix them if it asks.
    Selecting the PHP executable
  4. Proxy settings. If you use a proxy, enter it. If not, leave it blank.
    The proxy settings
  5. Review and install.
    Verifying the installation settings
  6. Read the summary of the environment changes, and click Install.
    The Composer agreement and summary
  7. Click Finish.
    Completing the Composer installation

The installer adds Composer to the PATH.

Check the install

Open a new Command Prompt and run:

composer -V
The Composer version

Use Composer

composer init
composer require vendor/package
composer install
composer update

Quick recap

  • Install PHP first and check php -v.
  • Run Composer-Setup.exe.
  • Check with composer -V in a new Command Prompt.