How To Install Composer?

How To Install Composer?

composer

A package-based dependency manager for PHP projects.

Maintainer: Debian PHP PEAR Maintainers



Section: php

Install composer

  • Debian apt-get install composer Click to copy
  • Ubuntu apt-get install composer Click to copy
  • Alpine OS apk add composer Click to copy
  • Arch Linux pacman -S composer Click to copy
  • Kali Linux apt-get install composer Click to copy
  • Fedora dnf install composer Click to copy
  • Raspbian apt-get install composer Click to copy
  • macOS brew install composer Click to copy

A package-based dependency manager for PHP projects.

How to use composer?

Below are few example commands for composer that you can use in the terminal.

Add a package as a dependency for this project, adding it to `composer.json`:
composer require user/package_nameClick to copy
Install all the dependencies in this project's `composer.json`:
composer installClick to copy
Uninstall a package from this project, removing it as a dependency from `composer.json`:
composer remove user/package_nameClick to copy
Update all the dependencies in this project's `composer.json`:
composer updateClick to copy
Update composer to the latest version:
composer self-updateClick to copy
Install the latest version of composer in Debian, Ubuntu, Alpine, Arch, Kali, Fedora, Raspbian and macOS from terminal. To install the composer just copy the above command for your OS and run into terminal. After you run the command it will grab the latest version of composer from the respository and install it in your computer/server.