[support] changing online/offline mode via db or settings.php doesn't work

Michael Prasuhn mike at mikeyp.net
Sun Nov 2 03:18:18 UTC 2008


In settings.php the value you are looking for is

$conf['site_offline'] = '1';

's:1:"1";' is a serialized value used to store PHP variables in a  
database column. It is basically short hand for, "a string whose  
length is 1 character(s), and contains the character 1."

If you change this in the database, you'll also want to delete the  
cached variables array from the cache table. To do this simply delete  
the row where CID = 'variables.' For example, run:

DELETE FROM cache WHERE cid = "variables";

Drupal will rebuild this array and cache it again the next time a  
variable is requested.

Hope this helps.

-Mike


On Nov 1, 2008, at 6:15 PM, Daniel Caillibaud wrote:

> Hello,
>
> On a drupal 6.6 multisite installation, I can't change the online  
> status with
> - changing the site_offline value (`s:1:"1";` or `s:1:"0";`) in the  
> variable table
> - adding $conf['site_offline'] = 's:1:"0";'; (or  
> $conf['site_offline'] = 's:1:"1";';) in my settings.php
> and I don't understand why!
>
> When I change the status by the "normal" way (admin/settings/site- 
> maintenance), the only change in the variable table are (by
> diff on 2 dumps):
>  before (online)
> INSERT INTO `dev_variable` VALUES ('site_offline','s:1:\"1\";');
> INSERT INTO `dev_variable` VALUES ('cache_flush','i:1225586663;');
>  after (offline)
> INSERT INTO `dev_variable` VALUES ('site_offline','s:1:\"0\";');
> INSERT INTO `dev_variable` VALUES ('cache_flush','i:1225587127;');
>
> Any idea ?
>
> PS:
> - I'm sure I'm changing the right table (when I change the status  
> with admin/settings/site-maintenance, I see the value change)
> - I'm sure I'm changing the right settings.php (I made a syntax  
> error to test)
>
> -- 
> Daniel
> -- 
> [ Drupal support list | http://lists.drupal.org/ ]

__________________
Michael Prasuhn
mike at mikeyp.net
http://mikeyp.net






More information about the support mailing list