7 if( !defined( 'MW_PHP4' ) ) {
8 die( "Not an entry point.");
11 if( isset( $_SERVER['SCRIPT_NAME'] ) ) {
12 // Probably IIS; doesn't set REQUEST_URI
13 $scriptUrl = $_SERVER['SCRIPT_NAME'];
14 } elseif( isset( $_SERVER['REQUEST_URI'] ) ) {
15 // We're trying SCRIPT_NAME first because it won't include PATH_INFO... hopefully
16 $scriptUrl = $_SERVER['REQUEST_URI'];
20 if ( preg_match( '!^(.*)/config/[^/]*.php$!', $scriptUrl, $m ) ) {
22 } elseif ( preg_match( '!^(.*)/[^/]*.php$!', $scriptUrl, $m ) ) {
25 $baseUrl = dirname( $scriptUrl );
29 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
30 <html xmlns
='http://www.w3.org/1999/xhtml' xml
:lang
='en' lang
='en'>
32 <title
>MediaWiki
<?php
echo htmlspecialchars( $wgVersion ); ?
></title
>
33 <meta http
-equiv
='Content-Type' content
='text/html; charset=utf-8' />
34 <style type
='text/css' media
='screen'>
37 background
-color
: #fff;
38 font
-family
: sans
-serif
;
54 <img src
="<?php echo htmlspecialchars( $baseUrl ) ?>/skins/common/images/mediawiki.png" alt
='The MediaWiki logo' />
56 <h1
>MediaWiki
<?php
echo htmlspecialchars( $wgVersion ); ?
></h1
>
59 MediaWiki requires PHP
5.0.0 or higher
. You are running PHP
60 <?php
echo htmlspecialchars( phpversion() ); ?
>.
65 * Test the *.php5 extension
67 $downloadOther = true;
69 $testUrl = "$wgServer$baseUrl/php5.php5";
70 if( function_exists( 'file_get_contents' ) ) {
71 $errorLevel = error_reporting();
72 error_reporting( $errorLevel & !E_WARNING
);
74 ini_set( 'allow_url_fopen', '1' );
75 $s = file_get_contents( $testUrl );
77 error_reporting( $errorLevel );
80 if ( strpos( $s, 'yes' ) !== false ) {
81 $encUrl = htmlspecialchars( str_replace( '.php', '.php5', $scriptUrl ) );
82 echo "<p>You may be able to use MediaWiki using a <a href=\"$encUrl\">.php5</a> file extension.</p>";
83 $downloadOther = false;
86 if ( $downloadOther ) {
89 <a href
="http://www.php.net/downloads.php">upgrading your copy of PHP
</a
>.
90 PHP
4 is at the end of its lifecycle
and will not receive further security updates
.</p
>
91 <p
>If for some reason you really really need to run MediaWiki on PHP
4, you will need to
92 <a href
="http://www.mediawiki.org/wiki/Download">download version
1.6.x
</a
>
93 from our website
. </p
>