Ability to download/change specific PHP versions

Would it be possible to show a wider range of PHP versions that you can download?

Right now we show four versions of PHP to select from. With one that comes shipped with the app and three others that we can download if needed.

Could we have in the preferences menu an option to show all PHP versions to download or PHP versions to display in the PHP version dropdown shown on the install step/overview?

I know there are some client sites that need plugins that rely on very specific versions of PHP and having just the four options limits what can be done.

Iā€™m not sure how practical this is right now, since each version has to be compiled by the Local developers and might even be directly paired up with other services (like nginx).

That said, maybe a method of using custom versions entirely, where you point Local to the executable elsewhere on your computer, would be a possibility in the future for all these lightning-services. Actually, doing that may be a way to also streamline things such as native support on Apple Silicon, as well as being able to use precisely the build flags for PHP your web server uses, to better mirror the live config in Local.

But I donā€™t think something like that is too practical, as these services are built directly for Local and Iā€™m not sure Local can be quite Local as a tool that generally just works if they need to support any version of any of these services, including those some of us already have anyway via Homebrew.

This would be helpful for our support team to reproduce issues on customer websites. Even having one version per PHP minor version (7.0, 7.1, etc.) would be sufficient. We donā€™t need anything more specific than that.

5 Likes

My team is developing multiple plugins that have PHP 7.0 as a minimum requirement, so it would be lovely to have more minor versions to test with. Another option would be to have the ability to manually add more versions.

3 Likes

This would be a great tool for plugin developers as the ability to switch to a particular version of PHP would allow a lot of debugging.

1 Like

I am a local beginner. Iā€™ve only been using it for 1-2 months.

I need to test a plugin I developed on top of php7.0.0 and wordpress 4.9.22,
I would like to know how to manually install or downgrade to php7.0.0 and wordpress 4.9.22.
If I overwrite with wordpress 4.9.22 into wordpress6.1.1(rescent version), it is working well?

And How do I manually install PHP7.0.0?

1 Like

Came back to see if thereā€™s been any progress on this as I currently need to test PHP 7.0. Iā€™m really bummed to see itā€™s still not possible with LocalWP, as this seems like such a core feature.

2 Likes

I would like this feature as well as I do WordPress plugin support.

1 Like

Iā€™m also a developer who needs to support older PHP versions, and the small list of options limits Localā€™s usefulness to me.

I would need older PHP Versions as well.

1 Like

I also need this.

Upgraded to a new laptop and can no longer run a local non WP site because it needs PHP 5.6. Local made this so much easier.

1 Like

I wrote up steps on how to use PHP 5.6 if you have the existing folders (PHP site folder and Local application support folder) from a backup.

1 Like

I wanna do a plus one for this! It would be nice to always be able to have same php version in Local and on hosting.

1 Like

Are you using a host that still provides PHP versions lower than 7.3.5 @radeeven?

Hi @Nick-B, to add to the discussion ā€¦ for example, Cloudways only offers hosting for PHP 7.4 and above. I use Cloudways for my small business hosting but the plugins I offer are written to support much lower version combinations, not limited to my specific hosting provider ā€¦ because it is actually about the chosen hosting provider of the customer running my plugins in their environment, not my environment.

From a pure WordPress statistics perspective; out of the ~493 million online WordPress websites (as-at 2024-11) that leaves at least ~11.3% (~55.7 million) incompatible WordPress websites with my specific hosting provider; but not where my plugin customers might be running their WordPress website.

The key take away point is that those numbers are focused on the online hosting providers alignment with a ā€˜PHP only perspectiveā€™ of compatible runtime environments ā€¦ which is not really aligned with the spirit of LocalWP target market is ā€¦ us maintainers, supporters, developers and tinkerers who dive under-the-hood to support a wide variety of runtime environments of our businesses & clients & personal learning adventures to explore the code ā€¦ not a few select hosting provider runtime environments.

From a WordPress Developers perspective, OliverJones described it quite well in this comment [ReddIt], which highlights it ā€œas the ability to test on older versionsā€ & ā€œwillingness to support older versionsā€. This forum thread is a clear vote for both of these considerations.

For me, this is where LocalWP is the shinning example of being the right-tool-for-the-job because in-theory I can support, test, step-debug and investigate combinations of runtime environments to reproduce a conversation and truly dig under-the-hood.

In turn, a fair question would be ā€¦ how far back should LocalWP offer the ability to run older versions of PHP? Huummm, the only way I can answer that, without sounding demanding, is to connect a few dots and tell a story as food-for-thought and leave it open for further discussion, remembering that in the end it is all just a choice. :vulcan_salute:

  1. Quote: ā€œThe only current officially supported version is the last major release of WordPressā€.

  2. When were the WordPress major versions released?

  • WordPress 6.0.0 was released 2022-05, ~2 years ago.
  • WordPress 5.0.0 was released 2018-12, ~6 years ago.
  • WordPress 4.0.0 was released 2014-09, ~10 years ago.
  • WordPress 3.0.0 was released 2010-06, ~14 years ago.
  1. How wide-spread are the WordPress major versions still in use?
  • WordPress 6 on ~423.339 million websites (~85.87%).
  • WordPress 5 on ~47.870 million websites (~9.71%).
  • WordPress 4 on ~19.326 million websites (~3.92%).
  • WordPress 3 on ~2.465 million websites (~0.50%).

Note: Allowing LocalWP to offer PHP versions that follow an ā€œn - 1ā€ support policy (WordPress 6 & 5) would give the application an impressive marketing message; like ā€œWith LocalWP you can support more than 95% of the WordPress websites on the internetā€.

  1. What minimum PHP version is required for WordPress?
  • WordPress 1.0.0 (2004-01) wants PHP 4.0.6 (2001-06) minimum.
  • WordPress 1.2.0 (2004-05) wants PHP 4.1.0 (2001-12) minimum.
  • WordPress 2.2.0 (2007-05) wants PHP 4.2.0 (2002-04) minimum.
  • WordPress 2.5.0 (2008-03) wants PHP 4.3.0 (2002-12) minimum.
  • WordPress 3.2.0 (2011-07) wants PHP 5.2.4 (2007-08) minimum.
  • WordPress 5.2.0 (2019-05) wants PHP 5.6.20 (2016-03) minimum.
  • WordPress 6.3.0 (2023-08) wants PHP 7.0.0 (2015-12) minimum.
  • WordPress 6.6.0 (2024-07) wants PHP 7.2.24 (2019-10) minimum.

Note: From a WordPress major version support perspective, PHP 5.6.20 is still the officially supported minimum version for WordPress 6.0.0; despite the security perspective recommendations (which are good best practices) to be up on a much higher PHP 7.4 version recommendation.

Note: From a time-and-effort perspective, allowing LocalWP application to download and run PHP 5.2.4 and PHP 5.6.20 and PHP 7.0.0 and PHP 7.2.24 would align with the significant WordPress minimum PHP versions supported. Yes, just these 4 PHP versions would get the job done for supported runtime environment alignments for us WordPress maintainers, supporters, developers and tinkerers (the most likely LocalWP target market audience).

  1. Allowing for PHP patches to the minor version (aka major.minor.patch.early); what would be the 4 historical PHP versions required to align LocalWP with the WordPress minimum PHP versions?
  • PHP 5.2.17 (2011-01) would cover WordPress 3.2.0 (2011-07) and above.
  • PHP 5.6.40 (2019-01) would cover WordPress 5.2.0 (2019-05) and above.
  • PHP 7.0.33 (2018-12) would cover WordPress 6.3.0 (2023-08) and above.
  • PHP 7.2.34 (2020-09) would cover WordPress 6.6.0 (2024-07) and above.
  • PHP 7.4.33 (2022-11) would cover big-brand Hosting Provider environments.

Request: With the above story in mind, can PHP 5.6.40, PHP 7.0.33, PHP 7.2.34 and PHP 7.4.33 be the historical PHP versions to be made available through the LocalWP application. Please, please, please.