Jump to navigation Jump to search

A Guide to Installing MediaWiki in a Hosted Environment

This article is part of a series compiled as a guide to assist individuals or others building a MediaWiki-based website in a hosted environment.

Manuals on the website are linked via buttons and the page content provides explanation or advice in the context of hosted sites.

Version and Compatibility

If your hosting provider offers the most recent version of MediaWiki for you to install you would assume that they would also have the right versions of MySQL and PHP required for a successful install. Unfortunately, that isn't always the case, so there are two things you need to know:-

  1. MediaWiki releases a major update every six months. A Long Term Support (LTS) version is released every two years. There is a one-year overlap in LTS support. So, if you are unable to install the latest version look for the most recent Long Term Support version and install that. Use that as your benchmark, and update from there. See the Version Lifecycle for details. Avoid an obsolete version. And definitely do not install anything prior to version 1.25 - that version had some significant changes and many extensions require 1.25 and above.
  2. Next, look at the Compatibility page. There are two important diagrams:-
    • for each version of Mediawiki, a diagram showing the versions of PHP which are compatible. There is some overlap.
    • for each version of Mediawiki, a diagram showing the versions of MySQL which are compatible. There is No overlap. This may be significant if your wiki is hosted - eg., if the hosting provider does not have MySQL 5.5.8+ then you cannot install Mediawiki 1.30+.
    Use the information to select the correct PHP version, and MySQL version if possible, through your host provider interface.

That should satisfy the Installation Requirements. If you read that Manual you will notice that in addition to the software itself, MediaWiki requires a web server and a database server, both of which are supplied and configured by the service provider in a hosted environment.

Installation Directory /w

If your domain name is then your hosting provider will likely allocate a folder or directory for your website with the name which is your root directory.

When you install Mediawiki, create a subdirectory /w which will be your installation directory.

Do not create a directory /wiki.

The logic is that if you want your wiki to use short url's like then you install the application in /w and then add some lines to your localsettings.php file to change /w to a virtual directory /wiki; and then the web server uses a file named .htaccess to re-write the URL without the index.php? in the URL. The article on Short URLs has more detail.

Preview or Open

If your installation of MediaWiki was successful, the web hosting interface may give you options to Open or Preview your new website.

  • Preview will give you an opportunity to see what the website looks like. Preview should work even if there are unresolved DNS issues.
  • Open will cause your web browser to attempt to load your new website over the Internet. It will be successful only if the domain name is resolved to an IP address; if the IP address and domain name point resolve to your particular website - host providers can share IP addresses; and if the web server can obtain the main page from MediaWiki. It may take several hours for DNS servers to replicate the information required for your website to be found, so be patient.


Having reached this far it may seem strange to suggest re-installing MediaWiki! But the logic is that it is a good idea to practice with the software, make changes, learn how to customize it, see if you can create a backup and recover that version - test a few things out - and then remove it all and start over with a 'clean' install for your production system.

During this process you may find that there are things mentioned in various manuals which you cannot do on a hosted environment. For example, you may be unable to run scripts, like maintenance scripts.

This advice may make more sense after working through the next step: Initial Configuration.