Drupal 9.4.10 is not compatible with PHP 7.4

Created on 30 January 2023, over 1 year ago
Updated 14 July 2023, about 1 year ago

Problem/Motivation

I recently upgraded our site from D9.3 to D9.4.10 and I have found the first bug of core code being incompatible with PHP 7.

ParseError: syntax error, unexpected '|', expecting ';' or '{' in Composer\Autoload\ClassLoader::Composer\Autoload\{closure}() (line 25 of core\modules\layout_builder\src\Normalizer\LayoutEntityDisplayNormalizer.php).

I do also see in the site's status report where it states: Drupal requires at least PHP 8.0.

The PHP Requirements are clearly defined here: https://www.drupal.org/docs/system-requirements/php-requirements β†’ stating that PHP 7.4 until D10.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ’¬ Support request
Status

Closed: outdated

Version

9.4

Component
Layout builderΒ  β†’

Last updated about 5 hours ago

Created by

πŸ‡¨πŸ‡¦Canada liquidcms

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

Comments & Activities

  • Issue created by @liquidcms
  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States cilefen

    Line 25 of core/modules/layout_builder/src/Normalizer/LayoutEntityDisplayNormalizer.php does not contain a | character.

  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    @liquidcms, could be a patch causing this.
    check core/PATCHES.txt for anything mentioning layout builder.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10
  • πŸ‡©πŸ‡ͺGermany meyertox

    Same problem (Installation of 9.4.10) with PHP 7.4.30 during update.php on th "verfying requirements page": Update stops with "7.4.30
    Your PHP installation is too old. Drupal requires at least PHP 8.0. It is recommended to upgrade to PHP version 8.0 or higher for the best ongoing support. "

  • πŸ‡¨πŸ‡¦Canada liquidcms

    2 separate issues here..

    1. Core (status report and drush warnings) as well as the PHP System Requirements page definitely have been messed up with a misunderstanding of "required" vs "recommended".

    I think, although hard to tell from all the contradicting info, that the Requirements page is still correct (D9 requires PHP 7+, D10 requires PHP 8+). The status report and drush messages are false.

    2. as @joseph.olstad suggested, it is most likely my code error reported above is due to inadvertently updating a patch to a newer version (which is only for D10 and therefore adding PHP 8 code).

    As people start to migrate from PHP 7 as well as from D9 to D10, i can certainly see the confusion core is adding with the incorrect/inconsistent messaging. Consider the situations:
    - patches apply to D9 code but have PHP 8 code in them
    - D9 core is compatible with PHP 7 but contrib modules stating D9 compatibility may have PHP code in them (have come across a couple already)
    - many D9 contrib modules i suspect are not compatible with PHP 8.

  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    @liquidcms, thanks for illuminating this, yes it definately looks like the verifying requirements page. For us using D9.4.10 we've been using PHP 8.0 in production for a while no issues. Just starting to look into PHP 8.1 as contrib seems to be almost ready.

    For D7.94 I've got PHP 8.2 running nicely on a fairly complex site (and it's fast!), very pleased so far.

  • πŸ‡ΊπŸ‡ΈUnited States cilefen

    There definitely is a months- or years-old issue about the 7.4 supported version warning being confusing. If anyone can find that one it would be great.

  • Status changed to Closed: outdated about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States cilefen

    There have been no updatesβ€”I’m assuming this isn’t an extant issue. If I’m assuming wrong, reopen it with more information.

Production build 0.71.5 2024