Skip to content

Composer

Dependency manager for PHP projects: declare, install, and update the libraries your code uses.

Stars
29.6k
Forks
4.9k
Licence
MIT
Language
PHP
Last update
4 days ago
Type
Dev tool

What it is

Composer is a tool that helps PHP projects declare the outside libraries (called packages) they depend on and then installs and manages them. You list what your project needs, and Composer fetches those packages, mainly from Packagist.org, the public package index. The README describes it simply as helping you declare, manage, and install dependencies of PHP projects.

  • Declare the libraries a PHP web app needs and install them with one command
  • Keep a project's dependency versions consistent across machines
  • Publish your own PHP library so others can install it through Packagist
  • Update dependencies to newer versions within the constraints you set

Great for

  • PHP developers starting a new project who want standard third-party libraries
  • Teams that need a shared, repeatable way to install project dependencies
  • Developers maintaining existing PHP applications that already use Composer
  • Anyone who wants to pull in packages from Packagist.org

Not ideal for

  • People not writing PHP, since it manages only PHP packages
  • Teams needing private package hosting, which the README points to Private Packagist (a separate commercial product) for
  • Users on very old PHP versions without checking the LTS notes, because the latest release requires PHP 7.2.5 or above
Step-by-step guide: how to use ComposerInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    See the README

    You'll need: PHP 7.2.5 or above for the latest version (older PHP uses Composer 2.2 LTS) · unzip (or 7z/7zz) and git for most users

    Download and install

    Follow the official instructions at https://getcomposer.org/download/
  2. 2

    Run it

    • Install PHP 7.2.5 or above and the required binaries such as unzip and git
    • Download and install Composer using the official instructions at getcomposer.org/download
    • Open the documentation at getcomposer.org/doc to learn how to declare dependencies in your project
    • Run Composer in your project folder to install the packages you have declared
  3. 3

    Get the most out of it

    • Use the LTS release (Composer 2.2.x) if your PHP version is between 5.3.2 and 8.1, as the README describes
    • Install the ext-zip PHP extension if available, which the README says lets git alone be enough, though it is not recommended
    • Browse public packages on Packagist.org to find libraries to depend on
    • Consider Private Packagist if you need private package hosting

Downloads

Strengths

  • Widely used in the PHP ecosystem, with a large public package index at Packagist.org
  • Open source under the MIT license
  • Actively maintained, with a recent release (2.10.3) and an LTS branch (2.2) for older PHP versions

Trade-offs

  • Relies on several system tools such as unzip and git being installed; the README lists many binary dependencies
  • Only manages PHP packages, so it does not cover other languages' dependencies
  • Detailed usage lives on the external documentation site rather than in the README

How it compares

ProjectStarsTypeLevelUpdatedBest for
composer (this)29.6kDev toolbeginner4 days agoPHP developers starting a new project who want standard third-party libraries
pipenv25kDev toolbeginner5 days agoPython application developers who want one command set for environments and dependencies
poetry34.3kDev toolintermediate5 days agoPython developers starting a new project who want one config file for dependencies and packaging
vcpkg27.6kDev toolintermediate4 days agoC and C++ developers who need third-party libraries in their projects
pnpm37kDev toolbeginner4 days agoDevelopers working in Node.js projects who want faster installs and less disk use
patch-package11.2kDev toolbeginner1.1 years agoTeams running a Node.js app who need a quick fix to a dependency before the upstream project publishes one

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.