Magento Tutorials

How to Enable Developer Mode in Magento 2

Developer Mode is used in case you need to customize Magento 2 or install extensions.

Detailed consideration:

  • A symlink of each required file is published to the pub/static directory;
  • You will see uncaught exceptions in the browser;
  • System logging in var/report is verbal. The exception is put into the error handler;
  • The exception is generated if an event subscriber cannot be enforced.

Show the Current Mode

Magento 2 platform offers default mode, developer mode and production mode. To learn the current Magento mode, you need to run this command as the Magento file system owner.

  • If you have shared hosting, this is the user your provider gives you to log in to the server.
  • If you have a private server, it’s typically a local user account on the Magento server.

Command usage:

bin/magento deploy:mode:show

A message similar to the following displays:

Current application mode: developer.

Change Magento Mode to Developer

Make sure you have cleared generated classes and Object Manager entities like proxies to prevent unexpected errors.

After doing so, you can change modes. Use the following steps:

  1. If you’re changing from production mode to developer mode, delete the contents of the [cci]var/generation[/cci] and [cci]var/di[/cci] directories:
    rm -rf <your Magento install dir>/var/di/* <your Magento install dir>/var/generation/*
  2. Set the mode:
    bin/magento deploy:mode:set developer

    The following message displays:

    Switched to developer mode.

Hope this helps!

For more learning resources, SimiCart has a great Magento tutorial category that you must bookmark.

Is it helpful?

Marketing Executive/ Product Designer at SimiCart

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments