Website Without PHP
English (United States)US
  • English (United States)
  • Dutch (Netherlands)
Menu

Composer

Also known as: PHP package manager

Composer is a tool that downloads the code libraries a PHP project needs and notes exactly which versions, so the project can be rebuilt the same way anywhere.

Read the explanation

PHP and versions Last updated:

Composer is a tool that downloads the code libraries a PHP project needs and notes exactly which versions, so the project can be rebuilt the same way anywhere. Modern PHP software depends on it, and so do many WordPress themes, plugins and custom builds.

What is Composer?

Composer is the package manager for PHP. It records the exact versions, so a project can be rebuilt in the same way on any server.

A PHP project rarely contains only its own code. It uses libraries for sending email, handling images, talking to payment providers and much more. Composer fetches them, mostly from a public catalogue called Packagist, and places them in a vendor folder.

It also works out which versions fit together.

Two files do the work. composer.json lists what the project asks for and which versions are allowed, including which PHP version the project supports. composer.lock records the exact versions that were installed. With the lock file, a developer, a test server and the live server all run identical packages.

Why exact versions matter

Libraries have their own weaknesses and their own release cycles. A site with up-to-date PHP and outdated libraries in the vendor folder still has a vulnerability problem. The lock file makes it possible to see exactly what is installed.

Composer and your WordPress site

Which PHP version does your site report?

We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login.

You may never run Composer yourself. Still, it affects you when a developer builds a custom theme or plugin, when a shop or a larger plugin ships with a vendor folder, or when your site is set up with Composer from the start. In those cases, a PHP update is not only about PHP.

The packages must support the new version too.

That is where updates break. A package that declares support only up to an older branch makes Composer refuse to install on a newer one. Another case is a package that works but uses features that are on the way out, see deprecation.

How to check your packages

If you or your developer have access to the project, run composer outdated to see which packages have newer releases, and composer audit to check for known security advisories. Do this on a copy of the project, not on the live site. If you do not have the project, ask the developer for the lock file and for the PHP versions it supports.

A developer who works with Composer can answer both questions in a few minutes.

For a site without Composer, the same questions apply to each plugin: which PHP versions does it support, and when was it last updated?

When to act

Look at Composer when you plan a PHP update, when a developer builds something custom for you, or when an audit flags outdated libraries. Our PHP upgrade service includes checking whether the packages in your project support the target version. If a project has not been maintained for years, a PHP migration service can rebuild it on a modern foundation.

Not sure how this applies to your site?

Ask a person to take a look. We check which PHP version your site runs and whether the fix is in, and tell you the next step.

Ask a person to take a look

Or have PHP updated right away: PHP update from $555 excl. VAT

Frequently asked questions

Do WordPress sites use Composer?

Not always. Standard WordPress installs plugins through the admin. Many themes, plugins and custom builds still use Composer inside, and some sites manage all of WordPress with it.

What is the difference between composer.json and composer.lock?

composer.json lists the packages a project wants and the versions it accepts. composer.lock records the exact versions that were installed, so every environment gets the same ones.

Can Composer check for vulnerable packages?

Yes. The command composer audit checks the installed packages against known security advisories. Run it on a copy of the project.

Why does Composer refuse to run on my new PHP version?

A package in the project may declare that it only supports certain PHP versions. Composer reads that and stops. The fix is to update the package to a release that supports your PHP version.

Share this page

Ask your AI to explain

Opens the chat with a question about this page. An AI answer can differ; the sources above are leading.

This question is sent along: Summarise the confirmed facts on https://websitewithoutphp.com/en-us/glossary/composer/ in 5 short points, with the source per point.

  1. Domain
  2. Check
  3. Result
  4. Report

Which PHP version does your site run?

Enter your domain. We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login.

We keep the domain and the result, never your IP address.