I am trying to disable the Put store on the maintenance mode while installing/upgrading/backup creation under Magento connect in Magento admin.But I am unable to do that?
Is it possible to disable this feature, if yes how?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityAll the "maintenance mode" does is creating empty semaphore file maintenance.flag
to store root folder. You can create the file manually if you want to, however you can't get into backend interface after that. You can also delete it manually.
Maintenance flag behavior itself is simple and it can be found from index.php
file:
$maintenanceFile = 'maintenance.flag';
if (file_exists($maintenanceFile)) {
include_once dirname(__FILE__) . '/errors/503.php';
exit;
}
index.php
quits immediately before loading the "god" class (require_once $mageFilename;
). You must delete the file manually. Personally, I consider this behavior a "misfeature" (frontend and backend maintenance should be separate). As of turning it off completely; there's no elegant way to do that. As you can see, the behavior is hard coded to index.php
and nothing short of changing it helps you. It's core file however which means that whenever you upgrade the change gets wiped off.
Open the index.php
file from your Root folder:
if (file_exists($maintenanceFile))
{
// include_once dirname(__FILE__) . '/errors/503.php';
$path="maintenance.flag";
unlink($path);
exit;
}
Choose .htaccess file from the root directory And add the following code lines on the top: DirectoryIndex index.html index.php
Now create your custom HTML i.e.index.html file and you are done.
The other way you can add the following code : create > maintenance.flag And upload to the root folder of the website.
For Magento 2.0, the process has changed slightly.
Now, the filename is .maintenance.flag
and it goes into the var
directory under your Magento root.
For example, if you're running a LAMP stack with Magento 2.0 installed to /var/www/public_html/ then you could use touch /var/www/public_html/.maintenance.flag
to enable maintenance mode and rm /var/www/public_html/.maintenance.flag
to disable it.
The documentation also provides instructions on how to exempt specific IP addresses from maintenance mode to allow that traffic continued to access the site for testing.