PHPackages                             ctw/ctw-composer-plugin-composerlenientplugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ctw/ctw-composer-plugin-composerlenientplugin

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

ctw/ctw-composer-plugin-composerlenientplugin
=============================================

Composer plugin that relaxes the upper bound of the PHP platform, or of any package requirement, for an allowlist of packages, so dependencies capped to an older PHP (e.g. ~8.4.0) or an older dependency major (e.g. laminas/laminas-servicemanager ^3) resolve on a newer one without --ignore-platform-req, forking, or editing vendor.

2.0.2(2w ago)028↓50%BSD-3-ClausePHPPHP ^8.4CI passing

Since Jun 27Pushed 2w agoCompare

[ Source](https://github.com/jonathanmaron/ctw-composer-plugin-composerlenientplugin)[ Packagist](https://packagist.org/packages/ctw/ctw-composer-plugin-composerlenientplugin)[ RSS](/packages/ctw-ctw-composer-plugin-composerlenientplugin/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (10)Versions (6)Used By (0)

Composer Lenient Plugin
=======================

[](#composer-lenient-plugin)

[![Latest Stable Version](https://camo.githubusercontent.com/5db61969cebec835659151eedb9fbfd79e7a354d8da05a63a67cfc66d1d96e02/68747470733a2f2f706f7365722e707567782e6f72672f6374772f6374772d636f6d706f7365722d706c7567696e2d636f6d706f7365726c656e69656e74706c7567696e2f762f737461626c65)](https://packagist.org/packages/ctw/ctw-composer-plugin-composerlenientplugin)[![GitHub Actions](https://github.com/jonathanmaron/ctw-composer-plugin-composerlenientplugin/actions/workflows/ci.yml/badge.svg)](https://github.com/jonathanmaron/ctw-composer-plugin-composerlenientplugin/actions/workflows/ci.yml)

**Install Composer packages that cap their `php` requirement on a newer PHP — without `--ignore-platform-req`, without forking, and without editing anything in `vendor/`.**

`ctw/ctw-composer-plugin-composerlenientplugin` is a Composer 2 plugin that relaxes the **upper bound** of the `php` platform requirement for an explicit allowlist of packages, at dependency-solver pool-build time. It lets a package that is capped at, say, `~8.4.0` install cleanly on **PHP 8.5, 8.6, and later**, while every other platform check stays fully enforced and your real PHP version is never faked.

Since **2.x** the same mechanism widens **any package requirement**, not only `php` — for example letting a package that declares `laminas/laminas-servicemanager: ^3` also resolve against `^4` while upstream finishes a not-yet-released major bump. `php` and package requirements share one uniform config format; see [Configuration](#configuration) below.

Does this fix your problem?
---------------------------

[](#does-this-fix-your-problem)

If `composer install` or `composer update` fails on a newer PHP with a message like this:

```
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires laminas/laminas-tag ^2.11 -> satisfiable by laminas/laminas-tag[2.13.0].
    - laminas/laminas-tag 2.13.0 requires php ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 ->
      your php version (8.5.7) does not satisfy that requirement.

```

…then yes. The package's code runs fine on your PHP, but its declared `php` constraint has an **upper bound** (`~8.4.0`, ` **Use with care:** widening a non-`php` requirement only changes resolution — it does not make incompatible *code* work. Use it when you have evidence the package already runs against the newer version (for instance, upstream's own CI exercises it on an unreleased branch), and remove the rule once a properly-tagged release ships.

> **See also:** [README\_LAMINAS.md](README_LAMINAS.md) — a real-world walkthrough of using this plugin to run five Laminas packages on PHP 8.5, including how it compares to the alternatives.

Bootstrapping (first install only)
----------------------------------

[](#bootstrapping-first-install-only)

A plugin cannot rewrite the solver pool until it is itself installed and active, so the very first update — the one that physically installs this plugin — still needs the flag once:

```
# 1. Installs and activates the plugin (flag required this one time).
composer update -W --ignore-platform-req=php+

# 2. Plugin is active and rewrites the pool, baking the relaxed
#    constraint into composer.lock. No flag.
composer update -W
```

After that, every `composer install` and `composer update` runs **without**`--ignore-platform-req`, because the relaxed `php` constraint already lives in the lock file.

Verifying
---------

[](#verifying)

After the second update, the lock carries the widened constraint:

```
php -r '$l=json_decode(file_get_contents("composer.lock"),true);
foreach($l["packages"] as $p){ if($p["name"]==="laminas/laminas-tag"){ echo $p["require"]["php"],"\n"; } }'
# ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ^8.5
```

Run an update with `-v` to see exactly what was relaxed:

```
ctw-composer-plugin-composerlenientplugin: relaxed php for laminas/laminas-tag -> ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ^8.5

```

FAQ
---

[](#faq)

**Why does `composer install` say "your php version does not satisfy that requirement" on a newer PHP, even though the library works?**Because the library declares an *upper* bound on `php` (for example `~8.4.0`), and Composer enforces it literally. The code may be compatible, but Composer will not cross a declared cap.

**How do I install a package that does not officially support my PHP version?**Add the package to this plugin's `packages` allowlist and run `composer update`. The plugin widens only that package's `php` constraint; nothing else changes.

**Is this safe? Does it patch files in `vendor/`?**No files are patched. The change is made in memory during dependency resolution and recorded in `composer.lock`. Your real PHP version is never spoofed, and every other platform requirement (extensions, other packages' `php`) stays enforced.

**Does it affect deploys and CI?**Yes — positively. Because the relaxed constraint is baked into `composer.lock`, deploy and CI runs use a plain `composer install` with no `--ignore-platform-req` flag.

**Can I use it for the next PHP, like 8.6 or 8.7?**Yes. Set `"allow": "^8.6"` (or whatever you need). The default is `^8.5`, which permits 8.5 through the 8.x line but stops before 9.0, since a major release may introduce breaking changes.

Testing
-------

[](#testing)

```
composer install
composer test
```

The suite builds real `Composer\Package` objects and asserts the relaxed `php` constraint with `Composer\Semver\Semver`, so it exercises actual Composer semantics rather than mocking the constraint logic.

Caveats
-------

[](#caveats)

- The plugin only **widens** a requirement, and only by an OR (`|| `). It never narrows or removes a constraint.
- Widening a non-`php` requirement changes only *resolution*; it cannot make incompatible code work. Use such a rule only when the package already runs against the newer version, and drop it once a tagged release ships.
- Only the packages a rule names are affected; every rule's allowlist is deliberately explicit.
- Rules target tagged upstream releases. Branch/dev aliases are out of scope, as the affected packages resolve to plain tags.

Keywords
--------

[](#keywords)

Composer plugin · ignore-platform-req alternative · `your php version does not satisfy that requirement` · install package on PHP 8.5 / 8.6 · relax php platform constraint · php upper bound · unsupported PHP version · `config.platform.php` alternative · force composer install on newer PHP · `--ignore-platform-reqs`.

License
-------

[](#license)

See [LICENSE.md](LICENSE.md).

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance96

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Total

4

Last Release

18d ago

Major Versions

1.0.0 → 2.0.02026-07-17

PHP version history (2 changes)1.0.0PHP ^8.3

2.0.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/18d8bc9bdee8ab1b0cfccce6a06d2438acbed3a58b0046c4834c5678f6769342?d=identicon)[jonathanmaron](/maintainers/jonathanmaron)

---

Top Contributors

[![jonathanmaron](https://avatars.githubusercontent.com/u/298462?v=4)](https://github.com/jonathanmaron "jonathanmaron (37 commits)")

---

Tags

compatibilityphpplugincomposerplatformcomposer-plugindependency-resolutionphp-versionplatform-requirementplatform-checkignore-platform-reqignore-platform-reqsphp-constraintupper-boundconstraint-relaxationrequirement-relaxation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ctw-ctw-composer-plugin-composerlenientplugin/health.svg)

```
[![Health](https://phpackages.com/badges/ctw-ctw-composer-plugin-composerlenientplugin/health.svg)](https://phpackages.com/packages/ctw-ctw-composer-plugin-composerlenientplugin)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

3044.7M30](/packages/vaimo-composer-patches)[automattic/jetpack-autoloader

Creates a custom autoloader for a plugin or theme.

566.3M164](/packages/automattic-jetpack-autoloader)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5346.5M599](/packages/drupal-core-composer-scaffold)[liborm85/composer-vendor-cleaner

Composer Vendor Cleaner removes unnecessary development files and directories from vendor directory.

34438.8k1](/packages/liborm85-composer-vendor-cleaner)[opengento/composer-registration-plugin

This plugin allows to compile the Magento2 components registrations on composer install/update.

101.8k](/packages/opengento-composer-registration-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
