Skip to Content

Composer

Composer is a dependency manager for PHP that allows you to manage libraries, packages, and dependencies required by your PHP projects. It ensures that you have all the necessary packages and correct versions, making it easier to manage and maintain your PHP applications.

Table of Contents


Installation

Note

For Laragon users, composer is already available. Just launch Laragon > Terminal and type composer --version to check the version.

Option 1: Using choco

Open your terminal as Administrator

  • Press Windows Key + X and select Windows PowerShell (Admin) or Command Prompt (Admin).
  • Click Yes if prompted by the User Account Control dialog.

Install Composer using command

terminal
choco install composer -y
Note

The -y flag automatically accepts all prompts, making the installation seamless.

Verify the Installation:

terminal
composer --version

Option 2: Using scoop

Open your Terminal

  • You don’t need to run Terminal as an administrator for Scoop.

Install Composer using command

terminal
scoop bucket add main scoop install main/composer

Verify the Installation

terminal
composer --version

Option 3: Using Homebrew

Open your Terminal

Install Composer using command:

terminal
brew install composer

Step Verify the Installation

terminal
composer --version

Notes

  • Both Chocolatey and Scoop will handle adding Composer to your system’s PATH variable, so you can use Composer from any command line.

  • To update Composer in the future, use:

    • Chocolatey: choco upgrade composer
    • Scoop: scoop update composer
    • Homebrew: brew upgrade composer
Last updated on