XenForo Enable Debug Mode for Specific IP Addresses

Turn on debug mode only for specific users.

  1. Shriker
    Debug mode gives more access to error messages, debugging/performance information, and development tools. It should not be run on a production forum as it may degrade performance or even open up security issues. However, you can limit it so that debug mode only runs for a few specific users (usually those who are charged with maintaining your forum/server).

    Substitute 127.0.0.1 with the desired IP addresses that you wish to enable debug mode for.

    /library/config.php
    PHP:
    <?php

    $config
    ['db']['host'] = 'hostname';
    $config['db']['port'] = '3306';
    $config['db']['username'] = 'username';
    $config['db']['password'] = 'password';
    $config['db']['dbname'] = 'database';

    // Enable debug mode for these IP addresses
    $allowedIPs = array(
        
    '127.0.0.1'// First allowed IP address
        
    '127.0.0.1'// Second allowed IP address
    );

    if (
    in_array($_SERVER['REMOTE_ADDR'], $allowedIPs)) {
        
    $config['debug'] = true;
    }
    Now you can safely leave debug mode enabled, as only the allowed users will be able to access it.