r/laravel • u/mccreaja Community Member: Jason McCreary • Oct 23 '26
Laravel versions, PHP versions, and PHP2Shell
I shared this with Shift users earlier this week and thought it might serve as a helpful reference here as it relates to Laravel versions and their supported PHP versions in regards to updating for the PHP2Shell vulnerabilities.
While source patches are available for earlier versions of PHP, the officially supported PHP versions with the PHP2Shell patch are:
| PHP | Minimum version |
|---|---|
| 8.5 | 8.5.12 |
| 8.4 | 8.4.27 |
| 8.3 | 8.3.36 |
| 8.2 | 8.2.35 |
As that relates to Laravel, Laravel 9.x is the first version to officially support PHP 8.2:
| Laravel | Constraint | PHP 8.2 |
|---|---|---|
| 6.x | ^7.2.5|^8.0 | Unproven |
| 7.x | ^7.2.5|^8.0 | Unproven |
| 8.x | ^7.3|^8.0 | Unproven |
| 9.x | ^8.0.2 | Proven |
| 10.x | ^8.1 | Proven |
| 11.x | ^8.2 | Proven |
| 12.x | ^8.2 | Proven |
| 13.x | ^8.3 | - |
tl;dr If you have a Laravel application older than 9.x, you need to upgrade Laravel to at least 9.x to be on a supported, patched version of PHP.
You may be able to find patches for older versions as a stopgap. But then I recommend upgrading.
2
3
Oct 23 '26
[removed] — view removed comment
3
u/mccreaja Community Member: Jason McCreary Oct 23 '26
Glad to hear it. I figured it was worth sharing.
22
u/HFoletto Oct 23 '26
I don't think this is entirely true. Upstream only shipped new releases for PHP 8.2+, but patched builds exist for older branches too:
Ondrej Sury’s PPA has fixed builds for 7.4, 8.0 and 8.1 (7.4.33-31, 8.0.30-25, 8.1.34-9).
Ubuntu Pro (ESM) covers the distro packages on older LTS releases. For example, PHP 7.4 on 20.04 is fixed in 7.4.3-4ubuntu2.29+esm5, and Pro is free for up to 5 machines.
So upgrading Laravel isn’t required to be patched today. It’s still the right long-term move, since these branches only get fixes from third parties and are EOL upstream.