Problem/Motivation
D7's INSTALL.txt still mentions PHP 5.2 and MySQL 5.0 along with several other post EOL versions.
The community has been gradually updating D7's testing configuration on drupal.org in #3092260: [policy, no patch] Review and update automated testing config for 7.x branch.
The documentation page at https://www.drupal.org/docs/7/system-requirements/php-requirements is fairly up-to-date.
Proposed resolution
We need to decide on what minimum requirements are actually supported, and update all docs (+ testing config) accordingly.
In practical terms there's no intention to start introducing more modern PHP features that would break support on older PHP versions - for example D7 core will retain the long array syntax.
We do sometimes encounter issues where it'd be useful to use features that were introduced a long time ago in e.g. PHP 5.3 or 5.6, and it'd be helpful to have an official policy on where any cut off is.
Do any sites still realistically require PHP 5.3 support? Do any distros still support PHP 5.x?
There's no guarantee that the testing infrastructure for such old versions will remain available; it's getting increasingly onerous to set up those environments.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3319435-7.patch | 3.49 KB | mcdruid |
| #7 | interdiff-3319435-5-7.txt | 2.4 KB | mcdruid |
| #5 | 3319435-5.patch | 1.87 KB | mcdruid |
Comments
Comment #2
mcdruid commentedLooks like support for PHP 5.x is over in Debian - https://wiki.debian.org/PHP says Jessie 8 had PHP 5.6 but that went EOL mid 2020.
Ubuntu 16.04 which is still supported under ESM shipped with PHP 7.0, but actually 14.04 is covered by ESM until April 2024 now ( https://canonical.com/blog/ubuntu-14-04-and-16-04-lifecycle-extended-to-... ). Trusty (14.04) shipped with PHP 5.5.
Centos7 shipped with PHP 5.4 and still seems to be supported until mid-2024 according to https://wiki.centos.org/About/Product
So as of late 2022 it looks like a couple of the major distros still have some support for PHP 5.4 and PHP 5.5 for another ~18 months or so.
I'm inclined to say that any PHP features introduced in PHP 5.3 (or later) are okay to use, and in practical terms PHP 5.x in general is likely to receive minimal testing (I don't really expect any contrib projects are that careful about testing on such old versions).
I think the recommendation should be (/ remain) PHP 7.x or later.
Comment #3
mcdruid commentedI managed to get a PHP 5.2 environment going in docker (https://github.com/clagomess/docker-php-5.2 with the oracle stuff commented out FWIW).
It looks a lot like D7 doesn't work under PHP 5.2 at the moment anyway, which is not hugely surprising when we don't have automated testing available.
It probably wouldn't be a big deal to fix the initial problems that I ran across, as they're a few variations on this:
It looks like this is down to namespaces which are not supported in PHP 5.2 so e.g.
...and:
...cause problems.
We could fix these, but I'm not sure we should. If nobody has complained (AFAIK) about this since these changes were made...
There may be other issues too, and I don't think we should devote any resources to this.
That makes me think drawing the line at PHP 5.3 (with a recommendation to upgrade beyond PHP 5.x) is fine.
Comment #4
poker10 commentedI agree that fixing PHP 5.2 compatibility issues would be a inefficiently used time, unless there are good reasons to fix that (which I won't see). I doubt there is lot of sites running on PHP 5.2 and similar.
Probably the current "line" could be on PHP 5.3.3, which is anyway "required" by this SA - https://www.drupal.org/sa-core-2019-002
Comment #5
mcdruid commentedFirst pass at updating INSTALL.txt
I've removed some of the specifics about MySQL alternatives and generally based the minimum requirements on what we know D7 core currently passes tests with.
Comment #6
poker10 commentedThe changes looks good to me, +1.
Maybe it wouldn't be a bad idea if, in addition, we change the links to the PHP and MySQL/PostgreSQL/SQLite websites to the HTTPS variants, but it is only cosmetic change.
Just a note, after this will be commited, we will need to update these two pages as well:
Comment #7
mcdruid commentedThanks - updated the links as suggested. I've not gone through and changed every URL but the new ones we're adding should all be https now.
I've also updated the DRUPAL_MINIMUM_PHP constant, and another check that happens in install.php before the constant is defined.
There are a few other mentions of PHP 5.2 dotted around - e.g.:
Some of these could now be removed, but I think that could be looked at in a followup.
As for updating the system requirements docs page, there's the issue of whether PHP versions still have upstream support from the PHP maintainers (which will soon mean only PHP 8.x) but then of course there are lots of providers that do provide extended support of one form or another.
I'd say it's sufficient to mention that it's not a good idea to run a version without some ongoing upstream / provider support but we don't really need to get into tracking those details. Newer is generally more better :)
Comment #8
poker10 commentedLet's go ahead with this. We also got +1 from @Fabianx on Slack.
It needs a change record, so people are aware of this change. It would not be possible for example to install a new Drupal 7 on PHP lower than 5.3.3 (also update.php will be blocked because of un-met requirements), see:
Comment #10
mcdruid commentedDraft CR: https://www.drupal.org/node/3322488 ... it's fairly light on detail so far - do we need to add more about what the increased minimum constraint actually means in practice?
Committed - thanks!
Comment #11
poker10 commentedI have found this 4-years old issue discussing the similar, probably we can give credits also to the people from that issue?
#2581193: [Drupal 7] Require PHP 5.3
And yes, I think that 1 short sentence explaining possible consequences of this change will be worth, so that people are aware what can happen.
Comment #12
poker10 commentedProbably this is also related: #3155190: [meta] Should Drupal 7 drop support for older PHP versions?
Comment #14
poker10 commentedThis is also related: #2881982: D7 Raise MySQL recommended version to 5.5.3