Moodle site stuck up in Maintenance mode – how to proceed??

Recently one of my development Moodle site stuck up in the maintenance mode due to which I was not able to see any page on my Moodle site. A quick search on Moodle forums brought up so many tricks to restore the site back which I thought to share with all of my fellow readers.

The steps which you can take to restore your site back are:

  • Appending ‘/login/index.php’ in the URL of your site name – If you add ‘/login/index.php’ in the site URL then you can access the login page of your Moodle site e.g. if your site is running with a domain name then you can directly type in the address bar of your browser. It will allow you to login into your Moodle site and turn off the maintenance mode in the settings through Site Administration > Server > Maintenance Mode.
  • Directly trying the URL – which will again takes you to the login page and then redirects you to the maintenance page where you can turn off the maintenance mode.
  • Through Command line (CLI) –
         cd moodlecode/admin/cli/
         php maintenance.php --disable
  • Through Database – If you have database access then also you can deactivate the maintenance mode by changing the variable named “maintenance_enabled” to “0” in the “mdl_config table“. (that’s a zero.  1 is on)
  • Editing the config.php file – If you have access to your config.php file then you can add the following line in your config.php file:
    • $CFG->maintenance_enabled=0; (that's a zero and be sure to include the ';' at the end of that line.

Also check for a file maintenance.html in the Moodledata directory and delete it.

These are the different tricks which I collected during my search on Moodle forums. If you are still stuck up in the maintenance mode then better post a new thread in the Moodle forums or else share your tips in comments and I will update the article.



Jaswinder Singh

Jaswinder Singh, passionate about using Moodle in improving the Indian Education System and reaching the students in far flung areas where still education seems to be a impossible prospect of life. He is the author of the popular Moodle Book "How to use Moodle 2.7". In October 2016, Jaswinder was elected as the Moodle User's Association Committee member - the first to make it from India.

Related Articles