mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Check PHP and MySQL versions in install.php. see #11666
git-svn-id: http://svn.automattic.com/wordpress/trunk@12577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
713940a056
commit
459326c932
@ -82,6 +82,23 @@ function display_setup_form( $error = null ) {
|
|||||||
// Let's check to make sure WP isn't already installed.
|
// Let's check to make sure WP isn't already installed.
|
||||||
if ( is_blog_installed() ) {display_header(); die('<h1>'.__('Already Installed').'</h1><p>'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'</p></body></html>');}
|
if ( is_blog_installed() ) {display_header(); die('<h1>'.__('Already Installed').'</h1><p>'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'</p></body></html>');}
|
||||||
|
|
||||||
|
$php_version = phpversion();
|
||||||
|
$mysql_version = $wpdb->db_version();
|
||||||
|
$php_compat = version_compare( $php_version, $required_php_version, '>=' );
|
||||||
|
$mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
|
||||||
|
|
||||||
|
if ( !$mysql_compat && !$php_compat )
|
||||||
|
$compat = sprintf( __('You cannot install because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version );
|
||||||
|
elseif ( !$php_compat )
|
||||||
|
$compat = sprintf( __('You cannot install because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version );
|
||||||
|
elseif ( !$mysql_compat )
|
||||||
|
$compat = sprintf( __('You cannot install because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version );
|
||||||
|
|
||||||
|
if ( !$mysql_compat || !$php_compat ) {
|
||||||
|
display_header();
|
||||||
|
die('<h1>' . __('Insufficient Requirements') . '</h1><p>' . $compat . '</p></body></html>');
|
||||||
|
}
|
||||||
|
|
||||||
switch($step) {
|
switch($step) {
|
||||||
case 0:
|
case 0:
|
||||||
case 1: // in case people are directly linking to this
|
case 1: // in case people are directly linking to this
|
||||||
|
@ -64,7 +64,7 @@ $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>='
|
|||||||
elseif ( !$php_compat )
|
elseif ( !$php_compat )
|
||||||
printf( __('You cannot upgrade because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version );
|
printf( __('You cannot upgrade because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version );
|
||||||
elseif ( !$mysql_compat )
|
elseif ( !$mysql_compat )
|
||||||
printf( __('You cannot upgrade because because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version );
|
printf( __('You cannot upgrade because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version );
|
||||||
?>
|
?>
|
||||||
<?php else :
|
<?php else :
|
||||||
switch ( $step ) :
|
switch ( $step ) :
|
||||||
|
Loading…
Reference in New Issue
Block a user