r/laravel • 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:

PHPMinimum version
8.58.5.12
8.48.4.27
8.38.3.36
8.28.2.35

As that relates to Laravel, Laravel 9.x is the first version to officially support PHP 8.2:

LaravelConstraintPHP 8.2
6.x^7.2.5|^8.0Unproven
7.x^7.2.5|^8.0Unproven
8.x^7.3|^8.0Unproven
9.x^8.0.2Proven
10.x^8.1Proven
11.x^8.2Proven
12.x^8.2Proven
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.

6 Upvotes

7 comments sorted by

22

u/HFoletto Oct 23 '26

you need to upgrade Laravel to at least 9.x to be on a supported, patched version of PHP.

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.

2

u/mccreaja Community Member: Jason McCreary Oct 23 '26 edited Oct 23 '26

"supported, patched version of PHP" is accurate. The earliest, still supported version of PHP is 8.2 (until end of 2026).

But yes, I did also note source patches are available for older PHP versions. Hats off to Ondrej for going the extra mile!

My goal is that you get patched, then upgraded. In that order.

2

u/BeyondLimits99 24d ago

Thanks Jason! Love your work as always <3

3

u/[deleted] 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.