Bootstrap/Load: Reorganize the initialization flow so that the check for PHP and MySQL requirements could run as early as possible.
This allows us to use PHP 5.6+ syntax in more files, and display a proper error message on older PHP versions, instead of causing a parse error. Fixes #48059. Built from https://develop.svn.wordpress.org/trunk@46183 git-svn-id: http://core.svn.wordpress.org/trunk@45995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -131,13 +131,10 @@ function wp_check_php_mysql_versions() {
|
||||
$php_version = phpversion();
|
||||
|
||||
if ( version_compare( $required_php_version, $php_version, '>' ) ) {
|
||||
wp_load_translations_early();
|
||||
|
||||
$protocol = wp_get_server_protocol();
|
||||
header( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 );
|
||||
header( 'Content-Type: text/html; charset=utf-8' );
|
||||
/* translators: 1: Current PHP version number, 2: WordPress version number, 3: Minimum required PHP version number. */
|
||||
printf( __( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.' ), $php_version, $wp_version, $required_php_version );
|
||||
printf( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.', $php_version, $wp_version, $required_php_version );
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user