2 # MediaWiki web-based config/installation
3 # Copyright (C) 2004 Brion Vibber <brion@pobox.com>
4 # http://www.mediawiki.org/
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with this program; if not, write to the Free Software Foundation, Inc.,
18 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 # http://www.gnu.org/copyleft/gpl.html
21 error_reporting( E_ALL
);
22 header( "Content-type: text/html; charset=utf-8" );
23 @ini_set
( "display_errors", true );
25 ?
><!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
26 "http://www.w3.org/TR/html4/loose.dtd">
29 <meta http
-equiv
="Content-type" content
="text/html; charset=utf-8">
30 <title
>MediaWiki installation
</title
>
31 <style type
="text/css">
33 @import
"../skins/monobook/main.css";
37 margin
: 1em
0 1em
2.5em
;
44 .config
-section label
.column
{
56 zoom
: 100%
; /* IE hack */
59 .config
-section
.config
-desc
{
66 .iput
-text
, .iput
-password
{
73 background
-color
: #fff;
81 background
-color
: #FFF0F0;
82 border
: 2px solid red
;
90 list-style
-type
: none
;
91 list-style
-image
: none
;
112 <div id
="globalWrapper">
113 <div id
="column-content">
115 <div id
="bodyContent">
120 # Relative includes seem to break if a parent directory is not readable;
121 # this is common for public_html subdirs under user home directories.
123 # As a dirty hack, we'll try to set up the include path first.
125 $IP = dirname( dirname( __FILE__
) );
126 $sep = (DIRECTORY_SEPARATOR
== "\\") ?
";" : ":";
127 ini_set( "include_path", ".$sep$IP$sep$IP/includes$sep$IP/languages" );
129 define( "MEDIAWIKI", true );
130 define( "MEDIAWIKI_INSTALL", true );
131 require_once( "includes/Defines.php" );
132 require_once( "includes/DefaultSettings.php" );
133 require_once( "includes/MagicWord.php" );
134 require_once( "includes/Namespace.php" );
137 <h1
>MediaWiki
<?php
print $wgVersion ?
> installation
</h1
>
141 /* Check for existing configurations and bug out! */
143 if( file_exists( "../LocalSettings.php" ) ) {
144 dieout( " <p><strong>Setup has completed, <a href='../index.php'>your wiki</a> is configured.</strong></p>
146 <p>Please delete the /config directory for extra security.</p></div></div></div></div>" );
149 if( file_exists( "./LocalSettings.php" ) ) {
150 writeSuccessMessage();
155 if( !is_writable( "." ) ) {
156 dieout( "<h2>Can't write config file, aborting</h2>
158 <p>In order to configure the wiki you have to make the <tt>config</tt> subdirectory
159 writable by the web server. Once configuration is done you'll move the created
160 <tt>LocalSettings.php</tt> to the parent directory, and for added safety you can
161 then remove the <tt>config</tt> subdirectory entirely.</p>
163 <p>To make the directory writable on a Unix/Linux system:</p>
166 cd <i>/path/to/wiki</i>
172 require_once( "install-utils.inc" );
173 require_once( "maintenance/updaters.inc" );
176 function getEncoded( $data ) {
177 # removing latin1 support, no need...
180 function getSitename() { return $this->getEncoded( $this->Sitename
); }
181 function getSysopName() { return $this->getEncoded( $this->SysopName
); }
182 function getSysopPass() { return $this->getEncoded( $this->SysopPass
); }
187 <h2
>Checking environment
...</h2
>
188 <p
><em
>Please
include all of the lines below when reporting installation problems
.</em
></p
>
189 <ul
class="env-check">
193 $wgNoOutputBuffer = true;
194 $conf = new ConfigData
;
196 install_version_checks();
198 print "<li>PHP " . phpversion() . " installed</li>\n";
200 if( ini_get( "register_globals" ) ) {
203 <div style
="font-size:110%">
204 <strong
class="error">Warning
:</strong
>
205 <strong
>PHP
's <tt><a href="http://php.net/register_globals">register_globals</a></tt> option is enabled. Disable it if you can.</strong>
207 MediaWiki will work, but your server is more exposed to PHP-based security vulnerabilities.
214 if( ini_get( "magic_quotes_runtime" ) ) {
216 ?><li class='error
'><strong>Fatal: <a href='http
://www.php.net/manual/en/ref.info.php#ini.magic-quotes-runtime'>magic_quotes_runtime</a> is active!</strong>
217 This option corrupts data input unpredictably
; you cannot install
or use
218 MediaWiki unless this option is disabled
.
222 if( ini_get( "magic_quotes_sybase" ) ) {
224 ?
><li
class='error'><strong
>Fatal
: <a href
='http://www.php.net/manual/en/ref.sybase.php#ini.magic-quotes-sybase'>magic_quotes_sybase
</a
> is active
!</strong
>
225 This option corrupts data input unpredictably
; you cannot install
or use
226 MediaWiki unless this option is disabled
.
230 if( ini_get( "mbstring.func_overload" ) ) {
232 ?
><li
class='error'><strong
>Fatal
: <a href
='http://www.php.net/manual/en/ref.mbstring.php#mbstring.overload'>mbstring
.func_overload
</a
> is active
!</strong
>
233 This option causes errors
and may corrupt data unpredictably
;
234 you cannot install
or use MediaWiki unless this option is disabled
.
239 dieout( "</ul><p>Cannot install Mediawiki.</p>" );
242 if( ini_get( "safe_mode" ) ) {
243 $conf->safeMode
= true;
245 <li
><b
class='error'>Warning
:</b
> <strong
>PHP
's
246 <a href='http
://www.php.net/features.safe-mode'>safe mode</a> is active.</strong>
247 You may have problems caused by this
, particularly
if using image uploads
.
251 $conf->safeMode
= false;
255 $sapi = php_sapi_name();
256 $conf->prettyURLs
= true;
257 print "<li>PHP server API is $sapi; ";
260 case "apache2handler":
261 print "ok, using pretty URLs (<tt>index.php/Page_Title</tt>)";
265 case "apache2filter":
266 print "using ugly URLs (<tt>index.php?title=Page_Title</tt>)";
267 $conf->prettyURLs
= false;
270 print "unknown; using pretty URLs (<tt>index.php/Page_Title</tt>), if you have trouble change this in <tt>LocalSettings.php</tt>";
274 $conf->xml
= function_exists( "utf8_encode" );
276 print "<li>Have XML / Latin1-UTF-8 conversion support.</li>\n";
278 dieout( "PHP's XML module is missing; the wiki requires functions in
279 this module and won't work in this configuration.
280 If you're running Mandrake, install the php-xml package." );
283 $memlimit = ini_get( "memory_limit" );
284 $conf->raiseMemory
= false;
285 if( empty( $memlimit ) ||
$memlimit == -1 ) {
286 print "<li>PHP is configured with no <tt>memory_limit</tt>.</li>\n";
288 print "<li>PHP's <tt>memory_limit</tt> is " . htmlspecialchars( $memlimit ) . ". <strong>If this is too low, installation may fail!</strong> ";
289 $n = intval( $memlimit );
290 if( preg_match( '/^([0-9]+)[Mm]$/', trim( $memlimit ), $m ) ) {
291 $n = intval( $m[1] * (1024*1024) );
293 if( $n < 20*1024*1024 ) {
294 print "Attempting to raise limit to 20M... ";
295 if( false === ini_set( "memory_limit", "20M" ) ) {
298 $conf->raiseMemory
= true;
305 $conf->zlib
= function_exists( "gzencode" );
307 print "<li>Have zlib support; enabling output compression.</li>\n";
309 print "<li>No zlib support.</li>\n";
312 $conf->turck
= function_exists( 'mmcache_get' );
313 if ( $conf->turck
) {
314 print "<li><a href=\"http://turck-mmcache.sourceforge.net/\">Turck MMCache</a> installed</li>\n";
316 $conf->eaccel
= function_exists( 'eaccelerator_get' );
317 if ( $conf->eaccel
) {
318 $conf->turck
= 'eaccelerator';
319 print "<li><a href=\"http://eaccelerator.sourceforge.net/\">eAccelerator</a> installed</li>\n";
321 if (!$conf->turck
&& !$conf->eaccel
) {
322 print "<li>Neither <a href=\"http://turck-mmcache.sourceforge.net/\">Turck MMCache</a> nor <a href=\"http://eaccelerator.sourceforge.net/\">eAccelerator</a> are installed, " .
323 "can't use object caching functions</li>\n";
326 $conf->diff3
= false;
327 $diff3locations = array("/usr/bin", "/opt/csw/bin", "/usr/gnu/bin", "/usr/sfw/bin") +
explode($sep, getenv("PATH"));
328 $diff3names = array("gdiff3", "diff3", "diff3.exe");
330 $diff3versioninfo = array('$1 --version 2>&1', 'diff3 (GNU diffutils)');
331 foreach ($diff3locations as $loc) {
332 $exe = locate_executable($loc, $diff3names, $diff3versioninfo);
333 if ($exe !== false) {
340 print "<li>Found GNU diff3: <tt>$conf->diff3</tt>.</li>";
342 print "<li>GNU diff3 not found.</li>";
344 $conf->ImageMagick
= false;
345 $imcheck = array( "/usr/bin", "/usr/local/bin", "/sw/bin", "/opt/local/bin" );
346 foreach( $imcheck as $dir ) {
347 $im = "$dir/convert";
348 if( file_exists( $im ) ) {
349 print "<li>Found ImageMagick: <tt>$im</tt>; image thumbnailing will be enabled if you enable uploads.</li>\n";
350 $conf->ImageMagick
= $im;
355 $conf->HaveGD
= function_exists( "imagejpeg" );
356 if( $conf->HaveGD
) {
357 print "<li>Found GD graphics library built-in";
358 if( !$conf->ImageMagick
) {
359 print ", image thumbnailing will be enabled if you enable uploads";
363 if( !$conf->ImageMagick
) {
364 print "<li>Couldn't find GD library or ImageMagick; image thumbnailing disabled.</li>\n";
368 $conf->UseImageResize
= $conf->HaveGD ||
$conf->ImageMagick
;
370 # $conf->IP = "/Users/brion/Sites/inplace";
371 $conf->IP
= dirname( dirname( __FILE__
) );
372 print "<li>Installation directory: <tt>" . htmlspecialchars( $conf->IP
) . "</tt></li>\n";
374 # $conf->ScriptPath = "/~brion/inplace";
375 $conf->ScriptPath
= preg_replace( '{^(.*)/config.*$}', '$1', $_SERVER["PHP_SELF"] ); # was SCRIPT_NAME
376 print "<li>Script URI path: <tt>" . htmlspecialchars( $conf->ScriptPath
) . "</tt></li>\n";
378 print "<li style='font-weight:bold;color:green;font-size:110%'>Environment checked. You can install MediaWiki.</li>\n";
379 $conf->posted
= ($_SERVER["REQUEST_METHOD"] == "POST");
381 $conf->Sitename
= ucfirst( importPost( "Sitename", "" ) );
382 $defaultEmail = empty( $_SERVER["SERVER_ADMIN"] )
384 : $_SERVER["SERVER_ADMIN"];
385 $conf->EmergencyContact
= importPost( "EmergencyContact", $defaultEmail );
386 $conf->DBtype
= importPost( "DBtype", "mysql" );
387 $conf->DBserver
= importPost( "DBserver", "localhost" );
388 $conf->DBname
= importPost( "DBname", "wikidb" );
389 $conf->DBuser
= importPost( "DBuser", "wikiuser" );
390 $conf->DBpassword
= importPost( "DBpassword" );
391 $conf->DBpassword2
= importPost( "DBpassword2" );
392 $conf->DBprefix
= importPost( "DBprefix" );
393 $conf->DBmysql5
= (importPost( "DBmysql5" ) == "true") ?
"true" : "false";
394 $conf->RootPW
= importPost( "RootPW" );
395 $conf->LanguageCode
= importPost( "LanguageCode", "en" );
396 $conf->SysopName
= importPost( "SysopName", "WikiSysop" );
397 $conf->SysopPass
= importPost( "SysopPass" );
398 $conf->SysopPass2
= importPost( "SysopPass2" );
400 /* Check for validity */
403 if( $conf->Sitename
== "" ||
$conf->Sitename
== "MediaWiki" ||
$conf->Sitename
== "Mediawiki" ) {
404 $errs["Sitename"] = "Must not be blank or \"MediaWiki\"";
406 if( $conf->DBuser
== "" ) {
407 $errs["DBuser"] = "Must not be blank";
409 if( $conf->DBpassword
== "" ) {
410 $errs["DBpassword"] = "Must not be blank";
412 if( $conf->DBpassword
!= $conf->DBpassword2
) {
413 $errs["DBpassword2"] = "Passwords don't match!";
415 if( !preg_match( '/^[A-Za-z_0-9]*$/', $conf->DBprefix
) ) {
416 $errs["DBprefix"] = "Invalid table prefix";
419 if( $conf->SysopPass
== "" ) {
420 $errs["SysopPass"] = "Must not be blank";
422 if( $conf->SysopPass
!= $conf->SysopPass2
) {
423 $errs["SysopPass2"] = "Passwords don't match!";
426 $conf->License
= importRequest( "License", "none" );
427 if( $conf->License
== "gfdl" ) {
428 $conf->RightsUrl
= "http://www.gnu.org/copyleft/fdl.html";
429 $conf->RightsText
= "GNU Free Documentation License 1.2";
430 $conf->RightsCode
= "gfdl";
431 $conf->RightsIcon
= '${wgStylePath}/common/images/gnu-fdl.png';
432 } elseif( $conf->License
== "none" ) {
433 $conf->RightsUrl
= $conf->RightsText
= $conf->RightsCode
= $conf->RightsIcon
= "";
435 $conf->RightsUrl
= importRequest( "RightsUrl", "" );
436 $conf->RightsText
= importRequest( "RightsText", "" );
437 $conf->RightsCode
= importRequest( "RightsCode", "" );
438 $conf->RightsIcon
= importRequest( "RightsIcon", "" );
441 $conf->Shm
= importRequest( "Shm", "none" );
442 $conf->MCServers
= importRequest( "MCServers" );
444 /* Test memcached servers */
446 if ( $conf->Shm
== 'memcached' && $conf->MCServers
) {
447 $conf->MCServerArray
= array_map( 'trim', explode( ',', $conf->MCServers
) );
448 foreach ( $conf->MCServerArray
as $server ) {
449 $error = testMemcachedServer( $server );
451 $errs["MCServers"] = $error;
455 } else if ( $conf->Shm
== 'memcached' ) {
456 $errs["MCServers"] = "Please specify at least one server if you wish to use memcached";
459 /* default values for installation */
460 $conf->Email
=importRequest("Email", "email_enabled");
461 $conf->Emailuser
=importRequest("Emailuser", "emailuser_enabled");
462 $conf->Enotif
=importRequest("Enotif", "enotif_allpages");
463 $conf->Eauthent
=importRequest("Eauthent", "eauthent_enabled");
465 if( $conf->posted
&& ( 0 == count( $errs ) ) ) {
466 do { /* So we can 'continue' to end prematurely */
467 $conf->Root
= ($conf->RootPW
!= "");
469 /* Load up the settings and get installin' */
470 $local = writeLocalSettings( $conf );
471 $wgCommandLineMode = false;
474 if (!in_array($conf->DBtype
, array("mysql", "oracle"))) {
475 $errs["DBtype"] = "Unknown database type.";
478 print "<li>Database type: {$conf->DBtype}</li>\n";
479 $dbclass = 'Database'.ucfirst($conf->DBtype
);
480 require_once("$dbclass.php");
481 $wgDBtype = $conf->DBtype
;
482 $wgDBadminuser = "root";
483 $wgDBadminpassword = $conf->RootPW
;
484 $wgDBprefix = $conf->DBprefix
;
485 $wgCommandLineMode = true;
486 $wgUseDatabaseMessages = false; /* FIXME: For database failure */
487 require_once( "includes/Setup.php" );
490 require_once( "maintenance/InitialiseMessages.inc" );
492 $wgTitle = Title
::newFromText( "Installation script" );
493 $mysqlOldClient = version_compare( mysql_get_client_info(), "4.1.0", "lt" );
494 if( $mysqlOldClient ) {
495 print "<li><b>PHP is linked with old MySQL client libraries. If you are
496 using a MySQL 4.1 server and have problems connecting to the database,
497 see <a href='http://dev.mysql.com/doc/mysql/en/old-client.html'
498 >http://dev.mysql.com/doc/mysql/en/old-client.html</a> for help.</b></li>\n";
501 if ($conf->DBtype
== 'mysql') {
502 print "<li>Trying to connect to database server on $wgDBserver as root...\n";
503 $wgDatabase = $dbc->newFromParams( $wgDBserver, "root", $conf->RootPW
, "", 1 );
505 if( $wgDatabase->isOpen() ) {
506 $myver = get_db_version();
507 $wgDatabase->ignoreErrors(true);
509 print "<ul><li>Connected as root (automatic)</li></ul></li>\n";
511 print "<ul><li>MySQL error " . ($err = mysql_errno() ) .
512 ": " . htmlspecialchars( mysql_error() ) . "</li></ul></li>";
518 $errs["RootPW"] = "Check password";
520 print "<li>Trying regular user...\n";
521 /* Try the regular user... */
522 $wgDBadminuser = $wgDBuser;
523 $wgDBadminpassword = $wgDBpassword;
524 /* Wait one second for connection rate limiting, present on some systems */
526 $wgDatabase = Database
::newFromParams( $wgDBserver, $wgDBuser, $wgDBpassword, "", 1 );
527 if( !$wgDatabase->isOpen() ) {
528 print "<ul><li>MySQL error " . ($err = mysql_errno() ) .
529 ": " . htmlspecialchars( mysql_error() ) . "</li></ul></li>";
530 $errs["DBuser"] = "Check name/pass";
531 $errs["DBpassword"] = "or enter root";
532 $errs["DBpassword2"] = "password below";
533 $errs["RootPW"] = "Got root?";
535 $myver = mysql_get_server_info( $wgDatabase->mConn
);
536 $wgDatabase->ignoreErrors(true);
547 $errs["DBserver"] = "Connection failed";
550 $errs["DBserver"] = "Couldn't connect to database";
555 } else /* not mysql */ {
556 print "<li>Connecting to SQL server...";
557 $wgDatabase = $dbc->newFromParams($wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, 1);
558 if (!$wgDatabase->isOpen()) {
559 print " error: " . $wgDatabase->lastError() . "</li>\n";
561 $wgDatabase->ignoreErrors(true);
562 $myver = get_db_version();
566 if ( !$wgDatabase->isOpen() ) {
567 $errs["DBserver"] = "Couldn't connect to database";
571 print "<li>Connected to $myver";
572 if( version_compare( $myver, "4.0.0" ) < 0 ) {
573 die( " -- mysql 4.0 or later required. Aborting." );
575 $mysqlNewAuth = version_compare( $myver, "4.1.0", "ge" );
576 if( $mysqlNewAuth && $mysqlOldClient ) {
577 print "; <b class='error'>You are using MySQL 4.1 server, but PHP is linked
578 to old client libraries; if you have trouble with authentication, see
579 <a href='http://dev.mysql.com/doc/mysql/en/old-client.html'
580 >http://dev.mysql.com/doc/mysql/en/old-client.html</a> for help.</b>";
583 if( $mysqlNewAuth ) {
584 print "; enabling MySQL 4.1/5.0 charset mode";
586 print "; <b class='error'>MySQL 4.1/5.0 charset mode enabled,
587 but older version detected; will likely fail.</b>";
592 if ($conf->DBtype
== 'mysql') {
593 @$sel = mysql_select_db( $wgDBname, $wgDatabase->mConn
);
595 print "<li>Database <tt>" . htmlspecialchars( $wgDBname ) . "</tt> exists</li>\n";
597 $err = mysql_errno();
598 if ( $err != 1049 ) {
599 print "<ul><li>Error selecting database $wgDBname: $err " .
600 htmlspecialchars( mysql_error() ) . "</li></ul>";
603 $res = $wgDatabase->query( "CREATE DATABASE `$wgDBname`" );
605 print "<li>Couldn't create database <tt>" .
606 htmlspecialchars( $wgDBname ) .
607 "</tt>; try with root access or check your username/pass.</li>\n";
608 $errs["RootPW"] = "<- Enter";
611 print "<li>Created database <tt>" . htmlspecialchars( $wgDBname ) . "</tt></li>\n";
613 $wgDatabase->selectDB( $wgDBname );
617 if( $wgDatabase->tableExists( "cur" ) ||
$wgDatabase->tableExists( "revision" ) ) {
618 print "<li>There are already MediaWiki tables in this database. Checking if updates are needed...</li>\n";
620 # Create user if required
622 $conn = Database
::newFromParams( $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, 1 );
623 if ( $conn->isOpen() ) {
624 print "<li>DB user account ok</li>\n";
627 print "<li>Granting user permissions...";
628 if( $mysqlOldClient && $mysqlNewAuth ) {
629 print " <b class='error'>If the next step fails, see <a href='http://dev.mysql.com/doc/mysql/en/old-client.html'>http://dev.mysql.com/doc/mysql/en/old-client.html</a> for help.</b>";
632 dbsource( "../maintenance/users.sql", $wgDatabase );
642 print "<li>Finished update checks.</li>\n";
644 # FIXME: Check for errors
645 print "<li>Creating tables...";
646 if ($conf->DBtype
== 'mysql') {
648 print " using MySQL 5 table defs...";
649 dbsource( "../maintenance/mysql5/tables.sql", $wgDatabase );
651 print " using MySQL 4 table defs...";
652 dbsource( "../maintenance/tables.sql", $wgDatabase );
654 dbsource( "../maintenance/interwiki.sql", $wgDatabase );
656 dbsource( "../maintenance/oracle/tables.sql", $wgDatabase );
657 dbsource( "../maintenance/oracle/interwiki.sql", $wgDatabase );
660 print " done.</li>\n";
662 print "<li>Initializing data...";
663 $wgDatabase->insert( 'site_stats',
664 array( 'ss_row_id' => 1,
665 'ss_total_views' => 0,
666 'ss_total_edits' => 0,
667 'ss_good_articles' => 0 ) );
668 # setting up the db user
670 print "<li>Granting user permissions...</li>\n";
671 dbsource( "../maintenance/users.sql", $wgDatabase );
674 if( $conf->SysopName
) {
675 $u = User
::newFromName( $conf->getSysopName() );
676 if ( 0 == $u->idForName() ) {
678 $u->setPassword( $conf->getSysopPass() );
681 $u->addGroup( "sysop" );
682 $u->addGroup( "bureaucrat" );
684 print "<li>Created sysop account <tt>" .
685 htmlspecialchars( $conf->SysopName
) . "</tt>.</li>\n";
687 print "<li>Could not create user - already exists!</li>\n";
690 print "<li>Skipped sysop account creation, no name given.</li>\n";
693 $titleobj = Title
::newFromText( wfMsgNoDB( "mainpage" ) );
694 $article = new Article( $titleobj );
695 $newid = $article->insertOn( $wgDatabase );
696 $revision = new Revision( array(
698 'text' => wfMsg( 'mainpagetext' ) . "\n\n" . wfMsg( 'mainpagedocfooter' ),
701 'user_text' => 'MediaWiki default',
703 $revid = $revision->insertOn( $wgDatabase );
704 $article->updateRevisionOn( $wgDatabase, $revision );
707 initialiseMessages();
708 print "</pre></li>\n";
711 /* Write out the config file now that all is well */
712 print "<p>Creating LocalSettings.php...</p>\n\n";
713 $localSettings = "<" . "?php$endl$local$endl?" . ">";
714 // Fix up a common line-ending problem (due to CVS on Windows)
715 $localSettings = str_replace( "\r\n", "\n", $localSettings );
717 if( version_compare( phpversion(), "4.3.2" ) >= 0 ) {
718 $xt = "xt"; # Refuse to overwrite an existing file
720 $xt = "wt"; # 'x' is not available prior to PHP 4.3.2. We did check above, but race conditions blah blah
722 $f = fopen( "LocalSettings.php", $xt );
725 dieout( "<p>Couldn't write out LocalSettings.php. Check that the directory permissions are correct and that there isn't already a file of that name here...</p>\n" .
726 "<p>Here's the file that would have been written, try to paste it into place manually:</p>\n" .
727 "<pre>\n" . htmlspecialchars( $localSettings ) . "</pre>\n" );
729 if(fwrite( $f, $localSettings ) ) {
731 writeSuccessMessage();
734 die("<p class='error'>An error occured while writing the config/LocalSettings.php file. Check user rights and disk space then try again.</p>\n");
746 if( count( $errs ) ) {
747 /* Display options form */
749 if( $conf->posted
) {
750 echo "<p class='error-top'>Something's not quite right yet; make sure everything below is filled out correctly.</p>\n";
754 <form action
="index.php" name
="config" method
="post">
759 <div
class="config-section">
760 <div
class="config-input">
762 aField( $conf, "Sitename", "Wiki name:" );
765 <p
class="config-desc">
766 Preferably a short word without punctuation
, i
.e
. "Wikipedia".<br
>
767 Will appear
as the
namespace name
for "meta" pages
, and throughout the
interface.
770 <div
class="config-input">
772 aField( $conf, "EmergencyContact", "Contact e-mail:" );
775 <p
class="config-desc">
776 Displayed to users in some error messages
, used
as the
return address
for password reminders
, and used
as the
default sender address of e
-mail notifications
.
779 <div
class="config-input">
780 <label
class='column' for="LanguageCode">Language
:</label
>
781 <select id
="LanguageCode" name
="LanguageCode">
784 $list = getLanguageList();
785 foreach( $list as $code => $name ) {
786 $sel = ($code == $conf->LanguageCode
) ?
'selected="selected"' : '';
787 echo "\t\t<option value=\"$code\" $sel>$name</option>\n";
792 <p
class="config-desc">
793 Select the language
for your wiki
's interface. Some localizations aren't fully complete
. Unicode (UTF
-8) used
for all localizations
.
796 <div
class="config-input">
797 <label
class='column'>Copyright
/license
:</label
>
800 <li
><?php
aField( $conf, "License", "No license metadata", "radio", "none" ); ?
></li
>
801 <li
><?php
aField( $conf, "License", "GNU Free Documentation License 1.2 (Wikipedia-compatible)", "radio", "gfdl" ); ?
></li
>
803 aField( $conf, "License", "A Creative Commons license - ", "radio", "cc" );
804 $partner = "MediaWiki";
805 $exit = urlencode( "$wgServer{$conf->ScriptPath}/config/index.php?License=cc&RightsUrl=[license_url]&RightsText=[license_name]&RightsCode=[license_code]&RightsIcon=[license_button]" );
806 $icon = urlencode( "$wgServer$wgUploadPath/wiki.png" );
807 $ccApp = htmlspecialchars( "http://creativecommons.org/license/?partner=$partner&exit_url=$exit&partner_icon_url=$icon" );
808 print "<a href=\"$ccApp\" target='_blank'>choose</a>";
810 <?php
if( $conf->License
== "cc" ) { ?
>
812 <li
><?php
aField( $conf, "RightsIcon", "<img src=\"" . htmlspecialchars( $conf->RightsIcon
) . "\" alt='icon' />", "hidden" ); ?
></li
>
813 <li
><?php
aField( $conf, "RightsText", htmlspecialchars( $conf->RightsText
), "hidden" ); ?
></li
>
814 <li
><?php
aField( $conf, "RightsCode", "code: " . htmlspecialchars( $conf->RightsCode
), "hidden" ); ?
></li
>
815 <li
><?php
aField( $conf, "RightsUrl", "<a href=\"" . htmlspecialchars( $conf->RightsUrl
) . "\">" . htmlspecialchars( $conf->RightsUrl
) . "</a>", "hidden" ); ?
></li
>
821 <p
class="config-desc">
822 A notice
, icon
, and machine
-readable copyright metadata will be displayed
for the license you pick
.
826 <div
class="config-input">
827 <?php
aField( $conf, "SysopName", "Admin username:" ) ?
>
829 <div
class="config-input">
830 <?php
aField( $conf, "SysopPass", "Password:", "password" ) ?
>
832 <div
class="config-input">
833 <?php
aField( $conf, "SysopPass2", "Password confirm:", "password" ) ?
>
835 <p
class="config-desc">
836 An admin can lock
/delete pages
, block users from editing
, and other maintenance tasks
.<br
>
837 A
new account will be added only when creating a
new wiki database
.
840 <div
class="config-input">
841 <label
class='column'>Shared memory caching
:</label
>
844 <li
><?php
aField( $conf, "Shm", "No caching", "radio", "none" ); ?
></li
>
846 if ( $conf->turck
) {
848 aField( $conf, "Shm", "Turck MMCache", "radio", "turck" );
853 if ( $conf->eaccel
) {
855 aField( $conf, "Shm", "eAccelerator", "radio", "eaccel" );
859 <li
><?php
aField( $conf, "Shm", "Memcached", "radio", "memcached" ); ?
></li
>
861 <div style
="clear:left"><?php
aField( $conf, "MCServers", "Memcached servers:", "text" ) ?
></div
>
863 <p
class="config-desc">
864 Using a shared memory system such
as Turck MMCache
, eAccelerator
, or Memcached will speed
865 up MediaWiki significantly
. Memcached is the best solution but needs to be
866 installed
. Specify the server addresses
and ports in a comma
-separted
list. Only
867 use Turck shared memory
if the wiki will be running on a single Apache server
.
871 <h2
>E
-mail
, e
-mail notification
and authentication setup
</h2
>
873 <div
class="config-section">
874 <div
class="config-input">
875 <label
class='column'>E
-mail (general
):</label
>
877 <li
><?php
aField( $conf, "Email", "Enabled", "radio", "email_enabled" ); ?
></li
>
878 <li
><?php
aField( $conf, "Email", "Disabled", "radio", "email_disabled" ); ?
></li
>
881 <p
class="config-desc">
882 Use this to disable all e
-mail
functions (send a password reminder
, user
-to
-user e
-mail
and e
-mail notification
),
883 if sending e
-mails on your server doesn
't work.
885 <div class="config-input">
886 <label class='column
'>User-to-user e-mail:</label>
888 <li><?php aField( $conf, "Emailuser", "Enabled", "radio", "emailuser_enabled" ); ?></li>
889 <li><?php aField( $conf, "Emailuser", "Disabled", "radio", "emailuser_disabled" ); ?></li>
892 <p class="config-desc">
893 Use this to disable only the user-to-user e-mail function (EmailUser).
895 <div class="config-input">
896 <label class='column
'>E-mail notification:</label>
898 <li><?php aField( $conf, "Enotif", "Disabled", "radio", "enotif_disabled" ); ?></li>
899 <li><?php aField( $conf, "Enotif", "Enabled for user_talk changes only", "radio", "enotif_usertalk" ); ?></li>
900 <li><?php aField( $conf, "Enotif", "Enabled for user_talk and watch list changes (not recommended for large wikis)", "radio", "enotif_allpages" ); ?></li>
903 <div class="config-desc">
905 E-mail notification sends a notification e-mail to a user, when the user_talk page is changed
906 and/or when watch-listed pages are changed, depending on the above settings.
907 When testing this feature, be reminded, that obviously an e-mail address must be present in your preferences
908 and that your own changes never trigger notifications to be sent to yourself.</p>
910 <p>Users get corresponding options to select or deselect in their users' preferences
.
911 The user options are not shown on the preference page
, if e
-mail notification is disabled
.</p
>
913 <p
>There are additional options
for fine tuning in
/includes
/DefaultSettings
.php
.</p
>
916 <div
class="config-input">
917 <label
class='column'>E
-mail authentication
:</label
>
919 <li
><?php
aField( $conf, "Eauthent", "Disabled", "radio", "eauthent_disabled" ); ?
></li
>
920 <li
><?php
aField( $conf, "Eauthent", "Enabled", "radio", "eauthent_enabled" ); ?
></li
>
923 <div
class="config-desc">
924 <p
>E
-mail address authentication uses a scheme to authenticate e
-mail addresses of the users
. The user who initially enters
or changes his
/her stored e
-mail address
925 gets a link with a token mailed to that address
. The stored e
-mail address is authenticated at the moment the user comes back to the wiki via the link
.</p
>
927 <p
>The e
-mail address stays authenticated
as long
as the user does not change it
; the time of authentication is indicated
928 on the user preference page
.</p
>
930 <p
>If the option is enabled
, only authenticated e
-mail addresses can receive EmailUser mails
and/or
931 e
-mail notification mails
.</p
>
936 <h2
>Database config
</h2
>
938 <div
class="config-section">
939 <div
class="config-input">
940 <label
class='column'>Database type
:</label
>
942 <li
><?php
aField( $conf, "DBtype", "MySQL", "radio", "mysql"); ?
></li
>
943 <li
><?php
aField( $conf, "DBtype", "Oracle", "radio", "oracle" ); ?
></li
>
947 <div
class="config-input" style
="clear:left"><?php
948 aField( $conf, "DBserver", "SQL server host:" );
950 <p
class="config-desc">
951 If your database server isn
't on your web server, enter the name
952 or IP address here. MySQL only.
955 <div class="config-input"><?php
956 aField( $conf, "DBname", "Database name:" );
958 <div class="config-desc">
959 If using Oracle, set this to your connection identifier.
961 <div class="config-input"><?php
962 aField( $conf, "DBuser", "DB username:" );
964 <div class="config-input"><?php
965 aField( $conf, "DBpassword", "DB password:", "password" );
967 <div class="config-input"><?php
968 aField( $conf, "DBpassword2", "DB password confirm:", "password" );
970 <p class="config-desc">
971 If you only have a single user account and database available,
972 enter those here. If you have database root access (see below)
973 you can specify new accounts/databases to be created.
976 <div class="config-input"><?php
977 aField( $conf, "DBprefix", "Database table prefix:" );
979 <div class="config-desc">
980 <p>If you need to share one database between multiple wikis, or
981 MediaWiki and another web application, you may choose to
982 add a prefix to all the table names to avoid conflicts.</p>
984 <p>Avoid exotic characters; something like <tt>mw_</tt> is good.</p>
987 <div class="config-input"><label class="column">Database charset</label>
988 <div>Select one:</div>
990 <li><?php aField( $conf, "DBmysql5", "Backwards-compatible UTF-8", "radio", "false" ); ?></li>
991 <li><?php aField( $conf, "DBmysql5", "Experimental MySQL 4.1/5.0 UTF-8", "radio", "true" ); ?></li>
994 <p class="config-desc">
995 <b>EXPERIMENTAL:</b> You can enable explicit Unicode charset support
996 for MySQL 4.1 and 5.0 servers. This is not well tested and may
997 cause things to break. <b>If upgrading an older installation, leave
998 in backwards-compatible mode.</b>
1001 <div class="config-input">
1003 aField( $conf, "RootPW", "DB root password:", "password" );
1006 <p class="config-desc">
1007 You will only need this if the database and/or user account
1008 above don't already exist
.
1009 Do <em
>not
</em
> type in your machine
's root password! MySQL
1010 has its own "root" user with a separate password. (It might
1011 even be blank, depending on your configuration.)
1014 <div class="config-input" style="padding:2em 0 3em">
1015 <label class='column
'> </label>
1016 <input type="submit" value="Install MediaWiki!" class="btn-install" />
1026 /* -------------------------------------------------------------------------------------- */
1027 function writeSuccessMessage() {
1029 if ( ini_get( 'safe_mode
' ) && !ini_get( 'open_basedir
' ) ) {
1031 <p>Installation successful!</p>
1032 <p>To complete the installation, please do the following:
1034 <li>Download config/LocalSettings.php with your FTP client or file manager</li>
1035 <li>Upload it to the parent directory</li>
1036 <li>Delete config/LocalSettings.php</li>
1037 <li>Start using <a href='../index
.php
'>your wiki</a>!
1039 <p>If you are in a shared hosting environment, do <strong>not</strong> just move LocalSettings.php
1040 remotely. LocalSettings.php is currently owned by the user your webserver is running under,
1041 which means that anyone on the same server can read your database password! Downloading
1042 it and uploading it again will hopefully change the ownership to a user ID specific to you.</p>
1045 echo "<p>Installation successful! Move the config/LocalSettings.php file into the parent directory, then follow
1046 <a href='../index
.php
'>this link</a> to your wiki.</p>\n";
1051 function escapePhpString( $string ) {
1052 return strtr( $string,
1063 function writeLocalSettings( $conf ) {
1064 $conf->UseImageResize = $conf->UseImageResize ? 'true' : 'false';
1065 $conf->PasswordSender = $conf->EmergencyContact;
1066 $zlib = ($conf->zlib ? "" : "# ");
1067 $magic = ($conf->ImageMagick ? "" : "# ");
1068 $convert = ($conf->ImageMagick ? $conf->ImageMagick : "/usr/bin/convert" );
1069 $pretty = ($conf->prettyURLs ? "" : "# ");
1070 $ugly = ($conf->prettyURLs ? "# " : "");
1071 $rights = ($conf->RightsUrl) ? "" : "# ";
1072 $hashedUploads = $conf->safeMode ? '' : '# ';
1074 switch ( $conf->Shm
) {
1076 $cacheType = 'CACHE_MEMCACHED';
1077 $mcservers = var_export( $conf->MCServerArray
, true );
1081 $cacheType = 'CACHE_ACCEL';
1082 $mcservers = 'array()';
1085 $cacheType = 'CACHE_NONE';
1086 $mcservers = 'array()';
1089 if ( $conf->Email
== 'email_enabled' ) {
1090 $enableemail = 'true';
1091 $enableuseremail = ( $conf->Emailuser
== 'emailuser_enabled' ) ?
'true' : 'false' ;
1092 $eauthent = ( $conf->Eauthent
== 'eauthent_enabled' ) ?
'true' : 'false' ;
1093 switch ( $conf->Enotif
) {
1094 case 'enotif_usertalk':
1095 $enotifusertalk = 'true';
1096 $enotifwatchlist = 'false';
1098 case 'enotif_allpages':
1099 $enotifusertalk = 'true';
1100 $enotifwatchlist = 'true';
1103 $enotifusertalk = 'false';
1104 $enotifwatchlist = 'false';
1107 $enableuseremail = 'false';
1108 $enableemail = 'false';
1109 $eauthent = 'false';
1110 $enotifusertalk = 'false';
1111 $enotifwatchlist = 'false';
1114 $file = @fopen
( "/dev/urandom", "r" );
1116 $secretKey = bin2hex( fread( $file, 32 ) );
1120 for ( $i=0; $i<8; $i++
) {
1121 $secretKey .= dechex(mt_rand(0, 0x7fffffff));
1123 print "<li>Warning: \$wgSecretKey key is insecure, generated with mt_rand(). Consider changing it manually.</li>\n";
1126 # Add slashes to strings for double quoting
1127 $slconf = array_map( "escapePhpString", get_object_vars( $conf ) );
1128 if( $conf->License
== 'gfdl' ) {
1129 # Needs literal string interpolation for the current style path
1130 $slconf['RightsIcon'] = $conf->RightsIcon
;
1133 $sep = (DIRECTORY_SEPARATOR
== "\\") ?
";" : ":";
1135 # This file was automatically generated by the MediaWiki installer.
1136 # If you make manual changes, please keep track in case you need to
1137 # recreate them later.
1139 # See includes/DefaultSettings.php for all configurable settings
1140 # and their default values, but don't forget to make changes in _this_
1143 \$IP = \"{$slconf['IP']}\";
1144 ini_set( \"include_path\", \".$sep\$IP$sep\$IP/includes$sep\$IP/languages\" );
1145 require_once( \"includes/DefaultSettings.php\" );
1147 # If PHP's memory limit is very low, some operations may fail.
1148 " . ($conf->raiseMemory ?
'' : '# ' ) . "ini_set( 'memory_limit', '20M' );" . "
1150 if ( \$wgCommandLineMode ) {
1151 if ( isset( \$_SERVER ) && array_key_exists( 'REQUEST_METHOD', \$_SERVER ) ) {
1152 die( \"This script must be run from the command line\\n\" );
1154 } elseif ( empty( \$wgNoOutputBuffer ) ) {
1155 ## Compress output if the browser supports it
1156 {$zlib}if( !ini_get( 'zlib.output_compression' ) ) @ob_start( 'ob_gzhandler' );
1159 \$wgSitename = \"{$slconf['Sitename']}\";
1161 \$wgScriptPath = \"{$slconf['ScriptPath']}\";
1162 \$wgScript = \"\$wgScriptPath/index.php\";
1163 \$wgRedirectScript = \"\$wgScriptPath/redirect.php\";
1165 ## If using PHP as a CGI module, use the ugly URLs
1166 {$pretty}\$wgArticlePath = \"\$wgScript/\$1\";
1167 {$ugly}\$wgArticlePath = \"\$wgScript?title=\$1\";
1169 \$wgStylePath = \"\$wgScriptPath/skins\";
1170 \$wgStyleDirectory = \"\$IP/skins\";
1171 \$wgLogo = \"\$wgStylePath/common/images/wiki.png\";
1173 \$wgUploadPath = \"\$wgScriptPath/images\";
1174 \$wgUploadDirectory = \"\$IP/images\";
1176 \$wgEnableEmail = $enableemail;
1177 \$wgEnableUserEmail = $enableuseremail;
1179 \$wgEmergencyContact = \"{$slconf['EmergencyContact']}\";
1180 \$wgPasswordSender = \"{$slconf['PasswordSender']}\";
1182 ## For a detailed description of the following switches see
1183 ## http://meta.wikimedia.org/Enotif and http://meta.wikimedia.org/Eauthent
1184 ## There are many more options for fine tuning available see
1185 ## /includes/DefaultSettings.php
1186 ## UPO means: this is also a user preference option
1187 \$wgEnotifUserTalk = $enotifusertalk; # UPO
1188 \$wgEnotifWatchlist = $enotifwatchlist; # UPO
1189 \$wgEmailAuthentication = $eauthent;
1191 \$wgDBserver = \"{$slconf['DBserver']}\";
1192 \$wgDBname = \"{$slconf['DBname']}\";
1193 \$wgDBuser = \"{$slconf['DBuser']}\";
1194 \$wgDBpassword = \"{$slconf['DBpassword']}\";
1195 \$wgDBprefix = \"{$slconf['DBprefix']}\";
1196 \$wgDBtype = \"{$slconf['DBtype']}\";
1198 # Experimental charset support for MySQL 4.1/5.0.
1199 \$wgDBmysql5 = {$conf->DBmysql5};
1201 ## Shared memory settings
1202 \$wgMainCacheType = $cacheType;
1203 \$wgMemCachedServers = $mcservers;
1205 ## To enable image uploads, make sure the 'images' directory
1206 ## is writable, then uncomment this:
1207 # \$wgEnableUploads = true;
1208 \$wgUseImageResize = {$conf->UseImageResize};
1209 {$magic}\$wgUseImageMagick = true;
1210 {$magic}\$wgImageMagickConvertCommand = \"{$convert}\";
1212 ## If you want to use image uploads under safe mode,
1213 ## create the directories images/archive, images/thumb and
1214 ## images/temp, and make them all writable. Then uncomment
1215 ## this, if it's not already uncommented:
1216 {$hashedUploads}\$wgHashedUploadDirectory = false;
1218 ## If you have the appropriate support software installed
1219 ## you can enable inline LaTeX equations:
1220 # \$wgUseTeX = true;
1221 \$wgMathPath = \"{\$wgUploadPath}/math\";
1222 \$wgMathDirectory = \"{\$wgUploadDirectory}/math\";
1223 \$wgTmpDirectory = \"{\$wgUploadDirectory}/tmp\";
1225 \$wgLocalInterwiki = \$wgSitename;
1227 \$wgLanguageCode = \"{$slconf['LanguageCode']}\";
1229 \$wgProxyKey = \"$secretKey\";
1231 ## Default skin: you can change the default skin. Use the internal symbolic
1232 ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
1233 # \$wgDefaultSkin = 'monobook';
1235 ## For attaching licensing metadata to pages, and displaying an
1236 ## appropriate copyright notice / icon. GNU Free Documentation
1237 ## License and Creative Commons licenses are supported so far.
1238 {$rights}\$wgEnableCreativeCommonsRdf = true;
1239 \$wgRightsPage = \"\"; # Set to the title of a wiki page that describes your license/copyright
1240 \$wgRightsUrl = \"{$slconf['RightsUrl']}\";
1241 \$wgRightsText = \"{$slconf['RightsText']}\";
1242 \$wgRightsIcon = \"{$slconf['RightsIcon']}\";
1243 # \$wgRightsCode = \"{$slconf['RightsCode']}\"; # Not yet used
1245 \$wgDiff3 = \"{$slconf['diff3']}\";
1247 // Keep things in Unix line endings internally;
1248 // the system will write out as local text type.
1249 return str_replace( "\r\n", "\n", $localsettings );
1252 function dieout( $text ) {
1253 die( $text . "\n\n</body>\n</html>" );
1256 function importVar( &$var, $name, $default = "" ) {
1257 if( isset( $var[$name] ) ) {
1258 $retval = $var[$name];
1259 if ( get_magic_quotes_gpc() ) {
1260 $retval = stripslashes( $retval );
1268 function importPost( $name, $default = "" ) {
1269 return importVar( $_POST, $name, $default );
1272 function importRequest( $name, $default = "" ) {
1273 return importVar( $_REQUEST, $name, $default );
1278 function aField( &$conf, $field, $text, $type = "text", $value = "" ) {
1281 $xtype = "type=\"$type\"";
1286 if(!(isset($id)) or ($id == "") ) $id = $field;
1287 $nolabel = ($type == "radio") ||
($type == "hidden");
1289 if ($type == 'radio')
1290 $id .= $radioCount++
;
1295 echo "\t\t<label class='column' for=\"$id\">$text</label>\n";
1298 if( $type == "radio" && $value == $conf->$field ) {
1299 $checked = "checked='checked'";
1303 echo "\t\t<input $xtype name=\"$field\" id=\"$id\" class=\"iput-$type\" $checked value=\"";
1304 if( $type == "radio" ) {
1305 echo htmlspecialchars( $value );
1307 echo htmlspecialchars( $conf->$field );
1311 echo " $text</label>\n";
1315 if(isset($errs[$field])) echo "<span class='error'>" . $errs[$field] . "</span>\n";
1318 function getLanguageList() {
1319 global $wgLanguageNames;
1320 if( !isset( $wgLanguageNames ) ) {
1321 $wgContLanguageCode = "xxx";
1322 function wfLocalUrl( $x ) { return $x; }
1323 function wfLocalUrlE( $x ) { return $x; }
1324 require_once( "languages/Names.php" );
1329 $d = opendir( "../languages" );
1330 while( false !== ($f = readdir( $d ) ) ) {
1331 if( preg_match( '/Language([A-Z][a-z_]+)\.php$/', $f, $m ) ) {
1332 $code = str_replace( '_', '-', strtolower( $m[1] ) );
1333 if( isset( $wgLanguageNames[$code] ) ) {
1334 $name = $code . ' - ' . $wgLanguageNames[$code];
1338 $codes[$code] = $name;
1346 #Check for location of an executable
1347 # @param string $loc single location to check
1348 # @param array $names filenames to check for.
1349 # @param mixed $versioninfo array of details to use when checking version, use false for no version checking
1350 function locate_executable($loc, $names, $versioninfo = false) {
1351 if (!is_array($names))
1352 $names = array($names);
1354 foreach ($names as $name) {
1355 $command = "$loc".DIRECTORY_SEPARATOR
."$name";
1356 if (file_exists($command)) {
1360 $file = str_replace('$1', $command, $versioninfo[0]);
1361 if (strstr(`
$file`
, $versioninfo[1]) !== false)
1368 function get_db_version() {
1369 global $wgDatabase, $conf;
1370 if ($conf->DBtype
== 'mysql')
1371 return mysql_get_server_info( $wgDatabase->mConn
);
1372 else if ($conf->DBtype
== 'oracle')
1373 return oci_server_version($wgDatabase->mConn
);
1376 # Test a memcached server
1377 function testMemcachedServer( $server ) {
1378 $hostport = explode(":", $server);
1381 if ( !function_exists( 'fsockopen' ) ) {
1382 $errstr = "Can't connect to memcached, fsockopen() not present";
1384 if ( !$errstr && count( $hostport ) != 2 ) {
1385 $errstr = 'Please specify host and port';
1386 var_dump( $hostport );
1389 list( $host, $port ) = $hostport;
1393 $fp = @fsockopen
( $host, $port, $errno, $fsockerr, 1.0 );
1394 if ( $fp === false ) {
1395 $errstr = "Cannot connect to memcached on $host:$port : $fsockerr";
1399 $command = "version\r\n";
1400 $bytes = fwrite( $fp, $command );
1401 if ( $bytes != strlen( $command ) ) {
1402 $errstr = "Cannot write to memcached socket on $host:$port";
1406 $expected = "VERSION ";
1407 $response = fread( $fp, strlen( $expected ) );
1408 if ( $response != $expected ) {
1409 $errstr = "Didn't get correct memcached response from $host:$port";
1416 echo "<li>Connected to memcached on $host:$port successfully";
1422 <div
class="license">
1424 <p
>This program is free software
; you can redistribute it
and/or modify
1425 it under the terms of the GNU General
Public License
as published by
1426 the Free Software Foundation
; either version
2 of the License
, or
1427 (at your option
) any later version
.</p
>
1429 <p
>This program is distributed in the hope that it will be useful
,
1430 but WITHOUT ANY WARRANTY
; without even the implied warranty of
1431 MERCHANTABILITY
or FITNESS
FOR A PARTICULAR PURPOSE
. See the
1432 GNU General
Public License
for more details
.</p
>
1434 <p
>You should have received
<a href
="../COPYING">a copy of the GNU General
Public License
</a
>
1435 along with this program
; if not
, write to the Free Software
1436 Foundation
, Inc
., 59 Temple Place
- Suite
330, Boston
, MA
02111-1307, USA
.
1437 or <a href
="http://www.gnu.org/copyleft/gpl.html">read it online
</a
></p
>
1443 <div id
="column-one">
1444 <div
class="portlet" id
="p-logo">
1445 <a style
="background-image: url(../skins/common/images/mediawiki.png);"
1446 href
="http://www.mediawiki.org/"
1447 title
="Main Page"></a
>
1449 <script type
="text/javascript"> if (window
.isMSIE55
) fixalpha(); </script
>
1450 <div
class='portlet'><div
class='pBody'>
1452 <li
><strong
><a href
="http://www.mediawiki.org/">MediaWiki home
</a
></strong
></li
>
1453 <li
><a href
="../README">Readme
</a
></li
>
1454 <li
><a href
="../RELEASE-NOTES">Release notes
</a
></li
>
1455 <li
><a href
="../docs/">Documentation
</a
></li
>
1456 <li
><a href
="http://meta.wikipedia.org/wiki/MediaWiki_User's_Guide">User
's Guide</a></li>
1457 <li><a href="http://meta.wikimedia.org/wiki/MediaWiki_FAQ">FAQ</a></li>
1459 <p style="font-size:90%;margin-top:1em">MediaWiki is Copyright © 2001-2005 by Magnus Manske, Brion Vibber, Lee Daniel Crocker, Tim Starling, Erik Möller, Gabriel Wicke and others.</p>