diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 52f574212a..20cd768108 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -24,6 +24,11 @@ */ const DRUPAL_MINIMUM_PHP = '5.5.9'; +/** + * Maximum supported version of PHP for Drupal 8.4.x and lower. + */ +const DRUPAL_MAXIMUM_PHP = '7.1.999'; + /** * Minimum recommended value of PHP memory_limit. * diff --git a/core/modules/system/system.install b/core/modules/system/system.install index bb69bd33f5..f8d1b0deef 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -184,6 +184,12 @@ function system_requirements($phase) { return $requirements; } + if (version_compare($phpversion, DRUPAL_MAXIMUM_PHP) > 0) { + $requirements['php']['description'] = t('Drupal 8.4.x is not compatible with PHP 7.2 and higher. Please use PHP 7.1.x.'); + $requirements['php']['severity'] = REQUIREMENT_ERROR; + return $requirements; + } + // Suggest to update to at least 5.5.21 or 5.6.5 for disabling multiple // statements. if (($phase === 'install' || \Drupal::database()->driver() === 'mysql') && !SystemRequirements::phpVersionWithPdoDisallowMultipleStatements($phpversion)) {