Composer declares, resolves, and installs PHP package dependencies from Packagist or private feeds, using a lockfile and autoload rules for your application.
Overview
Composer is the standard dependency manager for PHP. You describe required libraries in a project manifest, run install or update, and Composer downloads compatible versions, writes a lockfile, and wires autoloading so your code can import vendor packages.
Packages are discovered on the public Packagist registry; teams can use Private Packagist for hosted private dependencies. The tool ships as a PHP executable installed globally or per project via the official installer, with long-term support builds still available for older PHP runtimes.
Day-to-day commands manage require, update, validate, and script hooks. Resolving versions uses a SAT solver originally ported from openSUSE’s Libzypp approach. Typical machines need unzip or 7z plus git for most workflows; additional VCS binaries appear when pulling dependencies from non-Git sources.
Security issues can be reported to the Packagist security contact. Community support is available through documentation, GitHub discussions, and Stack Overflow.
Key features
- Semantic version dependency resolution
- Packagist and private repository support
- LTS builds for older PHP
Use cases
- Installing PHP libraries in applications
- Pinning production dependency versions
- Publishing packages to Packagist
- Managing monorepo PHP components
- Private corporate package feeds