Magento: Enabling modules via local.xml

I wanted to enable some modules only locally, without the possibility to use them on production. This would eliminate a vulnerability of leaking debug data. As an example I will use Magneto Debug module.

To enable a module only locally and keep it turned off anywhere else.

  1. In app/etc/modules/Magento_Debug.xml delete the line
    <active>true</active>
  2. In app/etc/local.xml add the following lines
    <modules>
        <Magneto_Debug>
            <active>true</active>
        </Magneto_Debug>
    </modules>

Deleting the line from app/etc/modules/Magento_Debug.xml is required, because Magento firstly loads app/etc/local.xml and then overloads its content.