Categories


Archives


Recent Posts


Categories


Magento 2: Developer Mode

astorm

Frustrated by Magento? Then you’ll love Commerce Bug, the must have debugging extension for anyone using Magento. Whether you’re just starting out or you’re a seasoned pro, Commerce Bug will save you and your team hours everyday. Grab a copy and start working with Magento instead of against it.

Updated for Magento 2! No Frills Magento Layout is the only Magento front end book you'll ever need. Get your copy today!

For reasons that are way too complicated to get into on Magento Quickies, while Magento 2 still has the concept of a developer mode, there’s no longer a Mage::setIsDeveloperMode method. If you’d been lazily (like me. cough) editing index.php to switch your site into developer mode, that won’t work anymore. Your only choice is to set a web server environmental variable.

For all the proper grown up, lazy crufy, people using apache, this means adding the following line to .htaccess

SetEnv MAGE_MODE developer

Magento 1 developers will notice the environmental variable is now MAGE_MODE, and not MAGE_IS_DEVELOPER_MODE.

I’ve been told this snippet

...
location ~ .php$ {
    ...
    ## Magento 2 Developer mode
    fastcgi_param MAGE_MODE "developer";
    ...
}
...

will make your nginx web-servers happy. Being a frozen caveman developer, I’ll leave testing that up to you.

Copyright © Alana Storm 1975 – 2023 All Rights Reserved

Originally Posted: 20th August 2013

email hidden; JavaScript is required