Magento offers the possibility of running in one of 3 different modes: default
, developer
and production
. Each of these was design to fit a specific scenario and purpose.
Default more
The default
mode is the default :). If you just installed magento it will be running in this mode. Default
mode is a sort of hybrid mode between developer
and production
. It is kind of a demo mode that on one hand suppresses many of the technical error messages but on the other still generates code on the fly.
I believe it exists for people that are not even aware of these distinct modes and to allow them to run the website right out of the box. For those of you who know what they are doing you should really run on one of the other modes, depending on where you are on the stage of your site’s development.
Developer mode
If you are starting your magento website you should put it developer
mode. In developer
mode Magento will be much more strict in terms of PHP errors, and display raw exceptions directly on your browser. This will make development and troubleshooting a lot easier.
Also, in developer
mode Magento turns off it automatic code generation and disabled static view files caching.
For these reason, this mode is intended for development only and results in reduced performance.
To change to developer
mode you just need to run the following command on the terminal
php bin/magento deploy:mode:set developer
Production mode
The production
mode is intended for a production system. This optimized mode prevents showing errors and exceptions to the user and servers all static view files from cache only.
Also, no automatic code file compilation is done in production
mode and you are not allowed to enable or disable any cach in the admin.
If you want to make changes to your site’s code you will need to explicitly perform file compile and deploy static view files.
To change to production
mode you just need to run the following command on the terminal
php bin/magento deploy:mode:set production
Maintenance mode
One other “mode” that magento can run in is the maintenance
mode. This prevents access to your magento website (frontend and backend) unless your IP was previously whitelisted. All requests are redirected to a default Service Temporarily Unavailable
page.
When on this mode a file .maintenance.flag
is created in the var
directory.
To put your site in maintenance
mode run the following command on the terminal
php bin/magento maintenance:enable
To remove the maintenance
mode run
php bin/magento maintenance:disable