Discuss your project

Glossary

Composer (PHP)

Composer is the tool for managing dependencies in PHP projects. It reads the required libraries from the composer.json file, installs them into the project in suitable versions and records the exact installed versions in composer.lock.

October 25, 2026ComposerPHPDependenciesSupply Chain

Hardly any PHP application works without third-party libraries, for example for sending email, generating PDFs or entire frameworks such as Laravel. Composer, often called the package manager for PHP, takes care of including these packages. Unlike operating system package managers, Composer works per project: the packages end up in the vendor folder of the respective project. The default source is the public Packagist repository. You can also add your own or private package sources.

How Composer works

The difference between the central commands is important: composer install installs exactly the versions from the lock file. composer update resolves the dependencies again, fetches newer matching versions and rewrites the lock file.

Key commands

Security in the software supply chain

Every package is third-party code that runs with the application's permissions. Composer offers several aids for this:

In addition:

Typical use cases

How it differs

Composer manages PHP libraries at the project level. PHP extensions written in C that extend the interpreter itself, by contrast, are installed via the operating system or PECL. For JavaScript, npm fulfills a similar role to Composer. Git versions your own code, Composer the third-party building blocks.

Frequently asked questions

How often should dependencies be updated?

Security updates as soon as possible, once composer audit or a security advisory reports them. For all other updates, a fixed rhythm has proven useful, for example monthly, so that changes do not pile up over years into one large package that is hard to test.

What should you do if composer audit reports a vulnerability?

First read the advisory: Which versions are affected, and does your own application use the affected function? Then update the package in a targeted way, test it and deploy it. If no update is available, document the vulnerability with a justification and a compensating measure, and check again regularly.

May Composer run on the production server?

The usual approach is to install dependencies in the pipeline and deploy the finished package. If Composer does run on the server, use composer install --no-dev based on the reviewed lock file and never composer update.

Sources

View software development

EXPLORE THE GLOSSARY

Related Terms

More in Software Development

All Glossary Terms

YOUR NEXT STEP

What should
work better
next?

Tell us briefly what you have in mind. We will assess it and suggest a sensible next step.