Today we discuss about Magento 2 set deploy mode. There are three deploy mode available in magento 2 Default . Developer and Production mode. These three mode have different kind of behavior. So let talk about deploy mode in details. You can set deploy mode with following command.
Set deploy mode
Show deploy mode
This is by default when new magento 2 installed. Following behavior default mode have.
- errors logged in var/report, not displayed
- static created dynamically – copied! changes not visible. cached
Developer mode is min speed. You can set developer mode with following command.
- exceptions displayed, not logged
- exception thrown if bad event subscriber.
- var/report detailed
- static created dynamically – symlinked???, changes visible immediately
- error handler – throws exception instead of logging (notice etc.)
Production mode have max speed, no errors, no file generation. You can set production mode with following command.
- admin can’t enable/disable cache types
- errors logged, not displayed
- static not created dynamically, must be deployed
- not need for www-data to write, pub/static can be read-only