Skip to content

Updating libraries and framework dependencies in a controlled way

Every library an application uses receives fixes, new versions and, eventually, an end. Updating only when the occasion arises means collecting updates until each one has become too large. A fixed routine keeps them small.

  • Who it is forDevelopers, technical leads
  • LevelHow-to
  • Reading timeabout 8 minutes
  • Last updated24 October 2026

What you will learn

  • What a version number says about the risk of an update
  • What a regular update routine with Composer looks like
  • How to respond to security advisories and major version jumps
  • What happens to packages nobody maintains any more

In short

Update on a fixed schedule, in small batches and as a separate, reviewed piece of work: bug fixes and minor versions collected together, major jumps one at a time, security advisories immediately. Every update goes through the tests, is deployed on its own with its changed lock file, and can therefore be reverted on its own too.

What composer.json, composer.lock, install and update do in principle is explained in the article on Composer. This one is about the maintenance that follows.

What a version number promises

Most PHP packages follow semantic versioning (Semantic Versioning 2.0.0) with the scheme MAJOR.MINOR.PATCH. A new patch version fixes bugs without changing how the package is used. A minor version adds functionality in a backward-compatible way. A major version may contain incompatible changes. For versions below 1.0.0, the specification states explicitly that anything may change at any time.

Semantic versioning as a rule of thumb for the risk of an update
JumpExampleWhat it promisesHow to treat it
Patch3.1.0 → 3.1.4bug fixes, usage unchangedcollected in the routine
Minor1.2.0 → 1.3.1new features, existing usage unchangedcollected, with a look at the changelog
Major1.3.1 → 2.0.0incompatible changes allowedone at a time, as a task of its own
below 1.00.9.0 → 0.10.0no promiselike a major jump

The number is a statement of intent by the maintainers, not a guarantee. Even a patch can change a behaviour your code relied on without anyone meaning it to. That is why the test run decides in the end, not the digit.

An update routine that stays small

A fixed date, such as once a month, with the same sequence every time has proved its worth:

  1. Create a separate branch in version control.
  2. Check with composer outdated --direct which directly required packages have newer versions.
  3. Apply patch and minor updates together: with composer update --patch-only for the most cautious level, or selectively with composer update vendor/name --with-dependencies.
  4. Read the changelogs of the updated packages, at least the sections on changes and deprecations.
  5. Run the tests and check the most important processes on the test environment.
  6. Deploy the changed composer.lock as a commit of its own — on the server with composer install, not update.

According to the Composer documentation, update and require check by default, after resolving dependencies, whether security advisories exist for the packages; --no-audit switches this off. Since Composer 2.9 they also refuse, by default, to install versions affected by a known security advisory (the audit.block-insecure setting, described under policy in the current documentation). In addition, composer audit belongs in the automated test run, so that a new advisory is noticed even when nobody is updating. composer outdated --strict returns an error code as soon as anything is outdated — useful as a reminder in an automated run, but no reason to act on every notice at once.

What the commands show

A small project rebuilt locally with three packages shows how to read the output. The packages are made up; the output is real.

ShellComposer 2.10 · output shortened, tested with Composer 2.10.3 and PHP 8.4
$ composer outdated --direct
acme/legacy-xml 0.9.0 = 0.9.0
Package acme/legacy-xml is abandoned, you should avoid using it. Use acme/xml instead.
acme/mailer     1.2.0 ! 1.3.1
acme/pdf        3.1.0 ! 3.1.4

$ composer why-not acme/mailer 2.0.0
acme/shop-backend 1.0.0 requires acme/mailer (^1.2)
acme/mailer       2.0.0 requires php (>=8.4 but 8.3.0 is installed)

$ composer audit --locked
No security vulnerability advisories found.
Found 1 abandoned package:
| Abandoned Package | Suggested Replacement |
| acme/legacy-xml   | acme/xml              |
$ echo $?
1
! means a compatible newer version is available and should be applied. acme/mailer 2.0.0 does not appear as a major update because the project declares PHP 8.3 as its platform: version 2.0.0 requires PHP 8.4, and why-not names exactly that reason. audit ends with exit code 1 because an abandoned package is installed.

The example shows a connection that is easy to overlook: major version jumps often require a newer PHP version. Libraries and the PHP version are therefore planned together; see Upgrading the PHP version.

When a security advisory arrives

A security advisory does not wait for the monthly date. The process is shorter, but not hasty:

  • Check whether you are affected. Which versions are affected, and does the application use the affected feature at all? The advisory usually states both.
  • Update selectively. Only the affected package, with composer update vendor/name --with-dependencies, not everything at once. That keeps the change small and reviewable.
  • Resolve blockers. If the fixed version cannot be installed, composer why-not vendor/name version shows which dependency or platform setting stands in the way.
  • Keep a record. When it was reported, when it was assessed, when it was fixed. If questions come up later, this trail is worth more than any explanation after the fact.

Major jumps and framework upgrades

A major update of a central library or of the framework is a small project in its own right. Three rules keep it manageable:

  • One major version at a time. Going from version 4 to 6 means going through 5. Vendors’ upgrade guides usually describe one step each.
  • Clear the old version’s warnings first. Many frameworks already report, in the version before a major jump, which usages are going away. Working through those notices beforehand leaves little to do at the jump itself.
  • Do not mix it with business changes. An upgrade branch contains the upgrade. If something shows up afterwards, the cause is narrowed down.

How long a framework version is maintained is published by each project itself. Those dates belong in the same overview as PHP’s support periods, so they do not come as a surprise.

A hypothetical example

The package nobody maintains

During the monthly routine, composer audit reports an abandoned package: a small library for reading supplier files is marked as abandoned on Packagist, pointing to a successor package. Nothing breaks right away; the application keeps running.

The team weighs three options: switching to the successor package (a different interface, changes in two places), continuing the library as its own fork (and maintaining it from then on), or replacing the few functions in use with its own code. It chooses the switch, because the successor is maintained and the change is limited. Reference files from real deliveries show that the result stays the same.

Recognising and replacing abandoned packages

A package counts as abandoned when its maintainers mark it as such on Packagist, often naming a recommended successor. Composer displays this during installation and updates, and since Composer 2.7 composer audit treats an abandoned package as a failure by default. Many packages, however, are never marked; work on them simply stops.

Whether a package is still maintained can therefore often only be estimated. Indicators are the date of the last release, whether security reports get a response, whether the current PHP version is supported, and how many people carry the project. The more central a package is to your application, the earlier it pays to prepare a replacement. Postponed updates are a form of technical debt with a due date. If your codebase has a lot of it, that is a typical case for PHP modernisation.

Common misconceptions

Then they are no longer updates but a rebuild. The more versions lie between what is installed and what is current, the harder it is to trace a fault to its cause.

It is meant not to change usage; that is the maintainers’ intention. Whether your code relied on a behaviour that did change after all, only the test run will show.

The command only knows published advisories for the installed packages. It cannot see bugs in your own code or vulnerabilities nobody has reported yet.

Further sources

About the author

Fabian Lücker is managing partner of PHP Schmiede KG in Rheine and has worked in software development since 2007. He is responsible for development and design, and writes here about decisions that come up in real projects.

Have your dependencies gone without updates for a long time?

Send us the output of composer outdated, or tell us your framework and PHP version. We will assess which steps are needed and in which order.