How to Configure MediaWiki to Use Memcached Tutorial

Learn how to enable the use of Memcached on your MediaWiki website

This tutorial explains how to configure your MediaWiki application to use Memcached. MediaWiki natively supports Memcached. This means that you just need to enable this option.

In order to do this you have to edit the MediaWiki PHP configuration file - LocalSettings.php. This file is stored inside the web root folder. Open the file and find the following two lines of code which is usually around the end of the file:

Right below them add the following lines:

Note that you should replace the memcached_port with the correct port number for your hosting account. For details on how to find out the correct port you can check this tutorial.

Once you are ready with the changes to the file - save it to apply the changes. That's it - your MediaWiki application is now configured to use Memcached.