A while back I made a site for our Operettic society in Holland, after a while I transferred the maintenance to another person who came just recently back at me with a problem.

The site is stuck in maintenance mode, and also the /user/login doesn't work, I also tried the ?q=user possibility, but this also didn't work.

Also made the following query to the database:

UPDATE variable SET value = 's:1:"0";' WHERE name= 'site_offline';
DELETE FROM cache WHERE cid = 'variables';

Anyone some thoughts on this?

Thanks in advance!


2 Answers 2


If you can login with ssh on the server you could use drush to unset the maintenance mode±

drush vset maintenance_mode 0


I got one solution here. I faced this problem once and it worked for me. I logged in to the application by admin programmatically using below code

 global $user;
    $user = user_load(1);

Make sure to delete the above code once the site is set back from maintenance mode. Otherwise this will give administration access to any user visiting the website.

  • 2
    I would recommend you to elaborate on your answer for the sake of completeness.
    – Wtower
    Commented Nov 16, 2014 at 14:14
  • Very much so. I hope you don't intend to put that in the index.php or somewhere else that would run for any user that hits the page.
    – rooby
    Commented Nov 17, 2014 at 5:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.