Add a way to display a warning instead of an error when using an unsupported PHP version

Created on 28 November 2022, over 1 year ago
Updated 23 February 2023, over 1 year ago

Problem/Motivation

We are using PHP 7.4 on Debian. PHP 7.4 is unsupported by upstream as of today but Debian will maintain it until 2026 (Debian 11 EOL).
The Drupal status report displays an error saying:

Your PHP installation is too old. Drupal requires at least PHP 8.0.

The main problem this causes is that our CI checks if drush rq returns any error and the pipeline fails if it does.
We don't want to ignore errors altogether but we don't want to consider this an error because we know we are using a maintained version.

Steps to reproduce

  1. Install the Debian php7.4 package.
  2. Install Drupal 9.
  3. Browse to /admin/reports/status.

Proposed resolution

πŸ“Œ Special case Ubuntu PHP versions for some system_requirements() warnings Active has some discussion about detecting versions maintained by Debian or Ubuntu.
In the mean time, we could add a setting that turns this error into a warning.

πŸ› Bug report
Status

Active

Version

9.5

Component
SystemΒ  β†’

Last updated 1 day ago

No maintainer
Created by

πŸ‡«πŸ‡·France prudloff Lille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡ΏNew Zealand jweowu

    I'm marking this as a bug and bumping the priority to "major" for the reasons stated in #3328940: Drupal 9.4.x incorrectly reporting PHP 8 as a requirement β†’ :

    as Drupal 9 does NOT require PHP 8, telling me that it does is not merely bad information, but furthermore has a major impact of indicating to users that they need to change their hosting when they may have no such need at all (I've marked this issue as "Major" on this basis, because hosting changes can be a major endeavour, and so this is going to cause many people a lot of unnecessary worry).

    and:

    > we want people to be thinking about moving off PHP 7

    That's fine, and I support encouraging people to think about that -- but don't do it by lying to them.

    Warn them that PHP 7 is EOL. Tell them that they will need PHP 8 in order to upgrade to Drupal 10 (which they will need to do by date X). Tell them that they need to be planning for this move. Do all of those things; but don't lie to them and tell them that their current version of Drupal needs a newer version of PHP than it actually does (and that, by implication, it is really only working by accident at the moment -- or causing them to wonder whether it even is all working, and spend hours trying to validate all of the functionality).

    Please also understand that you're effectively telling PHP 7.4 users that they might break their currently-working web site if they apply a Drupal core security update, because even if their site is accidentally working at present, any new Drupal 9 code might not work correctly in anything other than PHP 8.

    Supplying accurate information is important at all times, but never more so than when you're presenting error messages.

  • πŸ‡¬πŸ‡§United Kingdom Finn Lewis

    I am trying to run update.php on a site running Drupal 9.5.3 and 7.4.3-4ubuntu2.17

    It seems that the PHP version warning is preventing me running update.php.

    I am seeing this message on a Drupal

    Warnings found
    PHP
    7.4.3-4ubuntu2.17
    Your PHP installation is too old. Drupal requires at least PHP 8.0. It is recommended to upgrade to PHP version 8.1.6 or higher for the best ongoing support. See PHP's version support documentation and the Drupal PHP requirements page for more information.

    And then below, just

    Check the messages and try again.

    It doesn't look like there are any other warnings or errors, so it seems this is blocking running update.php.

Production build 0.69.0 2024