nativeInstallermagento

Understand and configure Magento modes

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and Mac OS X) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). Learn more.

Magento works in different modes. The Bitnami Magento Stack enables “default” mode. These are the modes available:

  • Default: Enables you to deploy the Magento application on a single server without changing any settings. However, default mode is not optimized for production.

  • Developer: Intended for development only. It disables static view file caching, enables enhanced debugging and verbose loggind, which results in a slower performance.

  • Production: Intended for deployment on a production system. Exceptions are not displayed to the user, exceptions are written to logs only, and static view files are served from cache only. New or updated files are not written to the file system.

Find more details about modes in Magento’s official documentation.

In order to display the current mode, run the following command:

$ sudo installdir/apps/magento/htdocs/bin/magento-cli deploy:mode:show

A message similar to the following will appear:

Current application mode: default.

To change to another mode, run this command replacing MODE with the “default”, “developer” or “production”

$ sudo installdir/apps/magento/htdocs/bin/magento-cli deploy:mode:set MODE

Here’s an example that sets Magento to production mode:

$ sudo installdir/apps/magento/htdocs/bin/magento-cli deploy:mode:set production

A message similar to the following will appear:

Enabled maintenance mode
Starting compilation

If changing from production mode to developer mode, delete the contents of the var/generation and var/di directories before setting the mode:

$ sudo rm -rf installdir/apps/magento/htdocs/var/di/* installdir/apps/magento/htdocs/var/generation/*