How to enable debug mode

AndyB

Well-known member
The purpose of this thread is to explain how to enable the debug mode in your admin control panel. Having debug mode enabled allows you to change the Execution Order of Template Modifications as well as make other changes not possible until you have enabled debug mode.

1) Open your library/config.php file in an editor

2) Add the following code to the bottom of the file

PHP:
if ($_SERVER['REMOTE_ADDR'] == '25.6.92.50') {
    $config['debug'] = true;
}

Change the IP address to your home IP address.

3) Save file

You can safely leave the debug mode enabled and there is no reason to disable it.
 
It can actually be more useful to activate debug mode when a cookie is present rather than per IP address. This preserves debug mode even if your IP address changes (e.g. if you're on the road) and also limits it to your development browser.

PHP:
if ( isset($_COOKIE['my_dev_cookie']) ){
    $config['debug'] = true;
    $config['development']['enabled'] = true; // if you want dev mode
}

To create the actual cookie, just use the browser's dev tools (Application tab => Cookies, or with javascript in the console), or set up a small script that creates it instead.
 
Last edited:
Back
Top Bottom