User:Seb35/MediaWiki Archaeology

Today I took the challenge to make MediaWiki working with every version, from 1.28 (alpha) to 1.1, and test my wikifarm extension with old versions. The difficulty is: my laptop is a modern Linux with 64bit architecture with modern softwares, so the environment is 10 year more modern than first MediaWiki versions. I won the challenge :)

Below are some tricks, if you ever need to run an old version. In addition of the challenge, it can be useful if you want to test an old extension.

My web server is nginx 1.6.2; I used the module fastcgi to run PHP, and I used pretty URLs with fastcgi_split_path_info ^()(/.*)$; (no "/wiki/" subdirectory).

PHP versions

edit

The more you go to the past, the older becomes PHP. Here are the versions I used; I used the more recent working version (e.g. if a MW version works with PHP 5.6 and 7.0, the result is 7.0).

MediaWiki PHP
1.1-1.12 5.2
1-13-1.21 5.6
1.22-1.28alpha 7.0

The standard version in my Debian-based GNU/Linux is 5.6. I added the repository from Debian Stretch to obtain PHP 7.0.

I compiled PHP 5.2.17 from sources. If you ever need my configure, it was ./configure --prefix=/opt/php-5.2.17 --enable-fastcgi --with-zlib --with-bz2 --with-curl --enable-dba --enable-exif --with-gettext --enable-mbstring --with-mysql --with-mysqli --with-mysql-sock=/run/mysqld/mysqld.sock --enable-pcntl --enable-pdo --with-pdo-mysql --with-pdo-sqlite --disable-dom --disable-simplexml --with-libdir=lib/x86_64-linux-gnu. I had issues with DOM and SimpleXML extensions, and the with-libdir is needed to locate the mysqlclient library. To execute the FastCGI without the FPM I was accustomed, I copied the script from nginx.com.

I also compiled PHP 5.1.6, 5.0.5 and 4.4.9 with similar configure (without SQLite for 5.0.5 and 4.4.9). These are not needed since MediaWiki works with at least PHP 5.2, but it was for fun. If you have as much issues as I had with the mysqlclient library, I modified the configure for PHP 5.1 iirc to include my specific path.

Note PHP 5.0 and 4.4 don’t work with 64bits architectures [1], and 4.4 doesn’t like MySQL > 4.1 because authentication methods changed in MySQL 4.1 (so MW cannot connect to a MySQL 5.5 server) [2].

MediaWiki

edit

I created separated databases for each MW installation, with a dedicated MySQL user. Then I always installed MW from the web interface. No extensions were available in the extensions/ directory, and only MonoBook and Vector were available in skins/ (added in new versions).

No special comment for recent versions (>= 1.19).

For MediaWiki 1.13-1.20 with PHP 5.6, Special:Version was a blank page, and I had to do the following change to restore it:

includes/MagicWord.php, function getBaseRegex()
- $group = "(?P<{$i}_{$name}>" . preg_quote( $syn, '/' ) . ')';
+ $group = "(?P<i{$i}_{$name}>" . preg_quote( $syn, '/' ) . ')';

Another strange thing in these version: the main page (and others) is blank when I access the wiki directly, but contains its normal text when I access from the farm. Didn’t search why.

With MediaWiki 1.2-1.12, I had to change the file maintenance/tables.sql (or maintenance/mysql5/tables.sql) to replace "TYPE=InnoDB/HEAP/MyISAM" by "ENGINE=InnoDB/HEAD/MyISAM".

For MediaWiki <= 1.4 (about), you have to give the MySQL root password during the installation, else the installation doesn’t finish.

MediaWiki 1.1 is a bit harder to install because you need to follow the instructions of the file INSTALL, and understand install.php script will copy the files in another (final) directory. For this version (only), you also need to enable register_globals in PHP.

edit