How to enable the developer mode?

Magento supports a developer mode.
The developer mode is intended to be used and useful during development.
Particalary, Magento in developer mode shows exceptons on screen instead of showing a generic error message like "There has been an error processing your request".

How to enable the developer mode

Magento 1.x

Set the webserver environment variable MAGE_IS_DEVELOPER_MODE to any value, for example:

Listen 807
<VirtualHost 127.0.0.1:807>
	ServerName localhost.com
	DocumentRoot "C:/work/magento/1.9.2.0-rm3/code"
	SetEnv MAGE_IS_DEVELOPER_MODE "any value"
	SetEnv RM_DEVELOPER "1"
</VirtualHost>

Magento 2

Set the webserver environment variable MAGE_MODE to the value developer.

An example for Apache:

Listen 1900
<VirtualHost 127.0.0.1:1900>
	ServerName localhost.com
	DocumentRoot "C:/work/mage2.pro"
	SetEnv MAGE_MODE "developer"
	SetEnv MAGE_RUN_TYPE "website"
	SetEnv MAGE_RUN_CODE "mage2_pro"
	RemoteIPHeader X-Forwarded-For
</VirtualHost>

An example for Nginx:

location ~ \.php$ {
    fastcgi_param MAGE_MODE "developer";
}

Since 2015-08-24 the developer mode can also be enabled from the command line:

bin/magento deploy:mode:set developer 

See also: