From 6c3c1786e9c3099364415caee59945c555f89333 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 11 Nov 2006 16:59:32 +0000 Subject: [PATCH] * Run PHP install version checks on update.php so command-line updaters see new version requirements * Do a check for the PHP 5.0.x 64-bit bug, since this is much more disruptive as of MW 1.8 than it used to be. Install or upgrade now aborts with a warning and a request to upgrade. --- RELEASE-NOTES | 10 ++++++++++ install-utils.inc | 10 ++++++++++ maintenance/update.php | 2 ++ 3 files changed, 22 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index decf0a09cc..510f8254c3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -171,6 +171,12 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN $wgParserTestFiles. This can now be appended to by extensions or local configuration files so that extension or custom tests can be automatically run along with the main batch. +* Run PHP install version checks on update.php so command-line updaters see + new version requirements +* Do a check for the PHP 5.0.x 64-bit bug, since this is much more disruptive + as of MW 1.8 than it used to be. Install or upgrade now aborts with a + warning and a request to upgrade. + == Languages updated == @@ -193,6 +199,10 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN MediaWiki 1.9 requires PHP 5 (5.1 recommended). PHP 4 is no longer supported. +PHP 5.0.x fails on 64-bit systems due to serious bugs with array processing: +http://bugs.php.net/bug.php?id=34879 +Upgrade affected systems to PHP 5.1 or higher. + MySQL 3.23.x is no longer supported; some older hosts may need to upgrade. At this time we still recommend 4.0, but 4.1/5.0 will work fine in most cases. diff --git a/install-utils.inc b/install-utils.inc index 2bc67c287b..fa7b80e580 100644 --- a/install-utils.inc +++ b/install-utils.inc @@ -14,6 +14,16 @@ function install_version_checks() { echo "PHP 5.0.0 or higher is required. ABORTING.\n"; die( -1 ); } + + // Test for PHP bug which breaks PHP 5.0.x on 64-bit... + // As of 1.8 this breaks lots of common operations instead + // of just some rare ones like export. + $borked = str_replace( 'a', 'b', array( -1 => -1 ) ); + if( !isset( $borked[-1] ) ) { + echo "PHP 5.0.x is buggy on your 64-bit system; you must upgrade to PHP 5.1.x\n" . + "or higher. ABORTING. (http://bugs.php.net/bug.php?id=34879 for details)\n"; + die( -1 ); + } global $wgCommandLineMode; $wgCommandLineMode = true; diff --git a/maintenance/update.php b/maintenance/update.php index d2dcbf92bb..402818ce14 100644 --- a/maintenance/update.php +++ b/maintenance/update.php @@ -18,6 +18,8 @@ $dbclass = 'Database' . ucfirst( $wgDBtype ) ; echo( "MediaWiki {$wgVersion} Updater\n\n" ); +install_version_checks(); + # Do a pre-emptive check to ensure we've got credentials supplied # We can't, at this stage, check them, but we can detect their absence, # which seems to cause most of the problems people whinge about -- 2.20.1