MediaWiki  REL1_19
PHPVersionError.php
Go to the documentation of this file.
00001 <?php
00019 function wfPHPVersionError( $type ){
00020         $mwVersion = '1.19';
00021         $phpVersion = PHP_VERSION;
00022         $message = "MediaWiki $mwVersion requires at least PHP version 5.2.3, you are using PHP $phpVersion.";
00023         if( $type == 'index.php' ) {
00024                 $encLogo = htmlspecialchars(
00025                         str_replace( '//', '/', pathinfo( $_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME ) . '/'
00026                         ) . 'skins/common/images/mediawiki.png'
00027                 );
00028 
00029                 header( $_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki configuration Error', true, 500 );
00030                 header( 'Content-type: text/html; charset=UTF-8' );
00031                 // Don't cache error pages!  They cause no end of trouble...
00032                 header( 'Cache-control: none' );
00033                 header( 'Pragma: nocache' );
00034 
00035                 $finalOutput = <<<HTML
00036 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
00037 <html xmlns='http://www.w3.org/1999/xhtml' lang='en'>
00038         <head>
00039                 <title>MediaWiki {$mwVersion}</title>
00040                 <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
00041                 <style type='text/css' media='screen'>
00042                         body {
00043                                 color: #000;
00044                                 background-color: #fff;
00045                                 font-family: sans-serif;
00046                                 padding: 2em;
00047                                 text-align: center;
00048                         }
00049                         p, img, h1 {
00050                                 text-align: left;
00051                                 margin: 0.5em 0;
00052                         }
00053                         h1 {
00054                                 font-size: 120%;
00055                         }
00056                 </style>
00057         </head>
00058         <body>
00059                 <img src="{$encLogo}" alt='The MediaWiki logo' />
00060                 <h1>MediaWiki {$mwVersion} internal error</h1>
00061                 <div class='error'>
00062                 <p>
00063                         {$message}
00064                 </p>
00065                 <p>
00066                         Please consider <a href="http://www.php.net/downloads.php">upgrading your copy of PHP</a>.
00067                         PHP versions less than 5.3.0 are no longer supported by the PHP Group and will not receive
00068                         security or bugfix updates.
00069                 </p>
00070                 <p>
00071                         If for some reason you are unable to upgrade your PHP version, you will need to
00072                         <a href="http://www.mediawiki.org/wiki/Download">download</a> an older version
00073                         of MediaWiki from our website.  See our
00074                         <a href="http://www.mediawiki.org/wiki/Compatibility#PHP">compatibility page</a>
00075                         for details of which versions are compatible with prior versions of PHP.
00076                 </p>
00077                 </div>
00078         </body>
00079 </html>
00080 HTML;
00081         // Handle everything that's not index.php
00082         } else {
00083                 // So nothing thinks this is JS or CSS
00084                 $finalOutput = ( $type == 'load.php' ) ? "/* $message */" : $message;
00085                 if( $type != 'cli' ) {
00086                         header( $_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki configuration Error', true, 500 );
00087                 }
00088         }
00089         echo( "$finalOutput\n" );
00090         die( 1 );
00091 }