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 requirement for an allowlist of packages, so dependencies capped to an older PHP (e.g. ~8.4.0) install on a newer PHP (8.5, 8.6+) without --ignore-platform-req, forking, or editing vendor.

1.0.0(yesterday)04↑2900%BSD-3-ClausePHPPHP ^8.3CI passing

Since Jun 27Pushed yesterdayCompare

[ 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 today

READMEChangelogDependencies (5)Versions (2)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/tests.yml/badge.svg)](https://github.com/jonathanmaron/ctw-composer-plugin-composerlenientplugin/actions/workflows/tests.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.

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`, `=8.6`, etc. for a different range.`packages`yes`[]`Exact package names to relax. Anything not listed resolves untouched.> **Tip:** list transitive dependencies explicitly. If a package such as `laminas/laminas-mail`is pulled in by another dependency rather than by your own `require`, it must still appear in `packages` or it will block resolution.

> **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** the `php` requirement, and only by an OR (`|| `). It never narrows or removes any other constraint, and never touches non-`php` requirements.
- Only the packages you name are affected; the allowlist is deliberately explicit.
- The allowlist targets 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

42

—

FairBetter than 89% of packages

Maintenance100

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

1d ago

### 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 (17 commits)")

---

Tags

compatibilityphpplugincomposerplatformcomposer-plugindependency-resolutionphp-versionplatform-requirementplatform-checkignore-platform-reqignore-platform-reqsphp-constraintupper-bound

###  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

[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k40.0M2.6k](/packages/ergebnis-composer-normalize)[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.

3014.5M22](/packages/vaimo-composer-patches)[automattic/jetpack-autoloader

Creates a custom autoloader for a plugin or theme.

545.9M113](/packages/automattic-jetpack-autoloader)[liborm85/composer-vendor-cleaner

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

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

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

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

PHPackages © 2026

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