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.
  • RPGfix

    RPGfix was born because of a need to sort through and categorize the multitudes of RPG sites that blink into existence every day — from the massive multi-server games to the smaller niche games.
  • Like us on Facebook

  • Support RPGfix!

    Want to help ensure that RPGfix continues to bring you the latest and greatest? Please consider supporting our Patreon. We'd really appreciate it!

    Become a Patron!
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice