Pin Symfony dependencies to ^7.4.0 to restore PHP 8.3 compatibility#59570
Pin Symfony dependencies to ^7.4.0 to restore PHP 8.3 compatibility#59570kuromadara wants to merge 1 commit intolaravel:13.xfrom
Conversation
|
Composer will only pull Symfony 8 components on a system not running PHP 8.3. If you develop a Laravel 13 app on a system with PHP 8.4 or 8.5 but need to support it running on an environment running PHP 8.3, you can add the following key to your project's {
"config": {
"platform": {
"php": "8.3.30"
}
}
}Pinning it to the lowest PHP version your project needs to support. Composer will use this information when resolving dependencies and won't pull any incompatible dependency. In other words, with this key added, Composer will keep pulling Symfony 7.4 components even if the development environment runs PHP 8.4 or 8.5. |
|
As @rodrigopedra says, this is not an issue, and the real problem is that you are specifically asking composer to install dependencies compatible with PHP 8.4, which is why they don't necessarily work on PHP 8.3. This has always been true, and if you install older versions of Laravel on a newer version of PHP, it also may not work properly on the oldest supported PHP version. You need to either run composer using the lowest version of PHP you want the dependencies to be compatible with, or ask its resolver to emulate the PHP version. This PR should not be merged, and no action needs to be taken. |
|
Laravel 12 uses symfony/console: ^7.2.0 and symfony/error-handler: ^7.2.0 GitHub — Symfony 7 only, no Symfony 8, so Laravel 12 on PHP 8.3 works perfectly fine with no issues. |
That makes sense, thank you for your quick response :) |
[13.x] Restoring PHP 8.3 Compatibility by Pinning Symfony ^7.4.0
Description
This PR addresses a dependency resolution issue in Laravel 13.x where transitive Symfony 8.0 components were forcing a PHP 8.4 requirement, despite Laravel 13 officially supporting PHP 8.3+.
By pinning the
symfony/*dependencies to^7.4.0(and^7.4.5forsymfony/process) across the framework and its sub-packages, we ensure that Composer resolves to Symfony 7.x on PHP 8.3 systems, fulfilling the framework's availability requirements.Related Issue
Fixes #59564
Benefit to End Users
Ensures that developers on PHP 8.3 can smoothly install and use Laravel 13 without encountering "Requirement not satisfied (php: ^8.4)" errors caused by transitive dependency resolution.
Why it does not break any existing features
13.xbranch pass with the same results as the existing baseline.Verification Conducted
composer updateon a PHP 8.3 environment; confirmed all Symfony components resolved correctly tov7.4.x.tests/Consoletests/Httptests/Routingtests/Mailtests/Sessiontests/Filesystemtests/FoundationNote: This PR targets the 13.x branch to ensure the upcoming major version maintains its documented PHP 8.3 support.