3 * Template used when the installer detects that this is PHP 4
9 if( !defined( 'MW_PHP4' ) ) {
10 die( "Not an entry point.");
13 if( isset( $_SERVER['SCRIPT_NAME'] ) ) {
14 // Probably IIS; doesn't set REQUEST_URI
15 $scriptUrl = $_SERVER['SCRIPT_NAME'];
16 } elseif( isset( $_SERVER['REQUEST_URI'] ) ) {
17 // We're trying SCRIPT_NAME first because it won't include PATH_INFO... hopefully
18 $scriptUrl = $_SERVER['REQUEST_URI'];
22 if ( preg_match( '!^(.*)/config/[^/]*.php$!', $scriptUrl, $m ) ) {
24 } elseif ( preg_match( '!^(.*)/[^/]*.php$!', $scriptUrl, $m ) ) {
27 $baseUrl = dirname( $scriptUrl );
31 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
32 <html xmlns
='http://www.w3.org/1999/xhtml' lang
='en'>
34 <title
>MediaWiki
<?php
echo htmlspecialchars( $wgVersion ); ?
></title
>
35 <meta http
-equiv
='Content-Type' content
='text/html; charset=utf-8' />
36 <style type
='text/css' media
='screen'>
39 background
-color
: #fff;
40 font
-family
: sans
-serif
;
56 <img src
="<?php echo htmlspecialchars( $baseUrl ) ?>/skins/common/images/mediawiki.png" alt
='The MediaWiki logo' />
58 <h1
>MediaWiki
<?php
echo htmlspecialchars( $wgVersion ); ?
></h1
>
61 MediaWiki requires PHP
5.1.x
or higher
. You are running PHP
62 <?php
echo htmlspecialchars( phpversion() ); ?
>.
67 * Test the *.php5 extension
69 $downloadOther = true;
71 $testUrl = "$wgServer$baseUrl/php5.php5";
72 if( function_exists( 'file_get_contents' ) ) {
73 $errorLevel = error_reporting();
74 error_reporting( $errorLevel & !E_WARNING
);
76 ini_set( 'allow_url_fopen', '1' );
77 $s = file_get_contents( $testUrl );
79 error_reporting( $errorLevel );
82 if ( strpos( $s, 'yes' ) !== false ) {
83 $encUrl = htmlspecialchars( str_replace( '.php', '.php5', $scriptUrl ) );
84 echo "<p>You may be able to use MediaWiki using a <a href=\"$encUrl\">.php5</a> file extension.</p>";
85 $downloadOther = false;
88 if ( $downloadOther ) {
91 <a href
="http://www.php.net/downloads.php">upgrading your copy of PHP
</a
>.
92 PHP
4 is at the end of its lifecycle
and will not receive further security updates
.</p
>
93 <p
>If for some reason you really really need to run MediaWiki on PHP
4, you will need to
94 <a href
="http://www.mediawiki.org/wiki/Download">download version
1.6.x
</a
>
95 from our website
. </p
>