How to Protect Upgrade.php in Elgg 1.8

Elgg has a nice feature called upgrade.php that allows you to flush the elgg cache and update your network layout. However if this tool is being run by several users at the same time, it could waste our server resources. For that reason in this article I will give a step by step guide on how to protect upgrade.php in elgg 1.8

1. In order to protect upgrade.php we will use a tool called Upgrade Key which can be downloaded here

2. After downloading the plugin, upload the plugin to the mod folder of your Elgg network to install it. If you don’t know how to do that, please read this article.

4. The upgrade key is now active, but still needs to be configure. First you need to set a 10 characters alphanumeric key, it can be anything you want (Numbers & Letters only). It should look like this:

iyrA4p22sw

5. Go to the root folder of your elgg network and open the ‘engine’ folder. Then open the file settings.php

6. Add this line below the global $Config

$CONFIG->upgrade_key = ‘iyrA4p22sw’;

Note: Replace the key with your own key. This is an example key only

Setting upgrade key

7. Save the changes and that’s it! Upgrade.php is now protected.

This tool will only let the Administrator of the elgg network to run upgrade.php This will ensure that no one abuses our server resources: