cancel
Showing results for 
Search instead for 
Did you mean: 

Maintenance.flag not working...

Maintenance.flag not working...

Hi folks...a newbie here but I'm getting the handle of it...

 

I've placed a blank file called "maintenance.flag" in the root of my store (where the app, var, etc files are) but it doesn't seem to be recoginized. In my host's file manager, I merely created a new file with the maintenance.flag" name. Is this more to it than that?

The index.php coding involved is below in case it's a help. The client needs this site (which was done by someone else) to be idled for a while until the catalog can be updated.

 

I'd sure appreciate any help that can be offered. I've searched for hours on line and can't find anything I'm doing wrong. 

 

$maintenanceFile = 'maintenance.flag';

if (!file_exists($mageFilename)) {
if (is_dir('downloader')) {
header("Location: downloader");
} else {
echo $mageFilename." was not found";
}
exit;
}

if (file_exists($maintenanceFile)) {
include_once dirname(__FILE__) . '/errors/503.php';
exit;

7 REPLIES

Re: Maintenance.flag not working...

Hi.

 

What you have done is correct which leads to be two conclusions. Either your filename is incorrect or the permission on the file is incorrect which means the file exists check cannot read it.

 

Try the following;

 

chmod 644 maintenance.flag
Problem solved? Click Accept as Solution!
www.iwebsolutions.co.uk | Magento Small Business Partner

Re: Maintenance.flag not working...

Thanks very much. I am able to change permissions via my host's file manager. The permissions previously read (and still read) 644. (Ihave no first digit where your "0" is shown).

 

The file I have created has the title "maintenance.flag". It is a blank file.

 

There is only 1 index.php at the root...I assume this must be the one being used.

 

There are many other files in the root, like the unzipped Magento files, etc. I am assuming that none of these are the culprit.

 

Re: Maintenance.flag not working...

Are you able to edit your index.php file? I would add in something like...

 

Mage::log('moo', null, 'check.log', true);

to the bottom of the index.php file just to make sure you are where you think you are.

Problem solved? Click Accept as Solution!
www.iwebsolutions.co.uk | Magento Small Business Partner

Re: Maintenance.flag not working...

Thanks again...I've installed the code as suggested...but have no idea what this should prove. Can you please elaborate?

 

Is it possible that my maintenance.flag file needs to be something more/other than a blank file. Perhaps needs some sort of action or type attached?

Re: Maintenance.flag not working...

What should happen now is a log file should appear in your var/log folder called check.log with an entry of "moo" in it. If that is the case then we are in the right file.

 

The maintenance.flag file does not need any content. I have tested this myself. It just needs to exist.

Problem solved? Click Accept as Solution!
www.iwebsolutions.co.uk | Magento Small Business Partner

Re: Maintenance.flag not working...

Thanks again for your help. I am going to look at this again.

 

The strange thing I found is that whoever set this site up...actually made two. One is listed as the site name...the other as the site name followed by "22". On the server, I see two complete sets of files, etc. I have to see which one is running the site/store.

 

In the meantime..I disabled the checkout process and modified the banner on the home page with a graphic stating that ordering is disabled while we update the catalog.

Re: Maintenance.flag not working...

Sorry folks that I haven't updated. What I wound up doing was disabling the mage shopiing cart and placing a graphic on the homepage banner that said Smiley Surprisedrdering is temporarily disabled while we update our catalog". This way, customers can still see the site, look at products, etc.

I do plan to once again review why there are two versions of the store in the hosting pages and perhaps that will explain. Although, I did place the maintenance flag in both.....