Setting Up a Debugging Environment

Applies to: Jamroom 7.0+ Last verified: 2026-10-24
  • What you need

    • A development site of its own, never your live site: on your computer, a local server, or a container. Jamroom needs PHP 7.2 or newer and MySQL or MariaDB: see Server Requirements.
    • An editor with PHP support, such as PhpStorm or VS Code with a PHP extension. See Setting Up Your Editor.
    • Xdebug, the PHP debugger, so you can stop the code at a line and look at every variable.
  • On the Jamroom site

    In Developer Tools, turn on Run in Developer Mode. Caching is off, templates are rebuilt on every request, and each module's Info tab lists its events.

    Optionally also turn on:

    • Template Name in Source: HTML comments show which template made each part of a page.
    • Skip Javascript Compression: each module's JavaScript loads as its own file, so the browser's debugger shows the real file and line.
  • Xdebug

    Install the Xdebug extension for your PHP version, for example with pecl install xdebug or your system's package (php-xdebug). Then in your php.ini:

    zend_extension=xdebug
    xdebug.mode=debug
    xdebug.start_with_request=trigger
    xdebug.client_host=127.0.0.1
    xdebug.client_port=9003
    • client_host is the computer your editor runs on. If PHP runs in a container or on another machine, use that computer's address as the server sees it (for Docker, often host.docker.internal).
    • With start_with_request=trigger, Xdebug only connects when asked: use your browser's Xdebug helper extension, or add XDEBUG_TRIGGER=1 to the URL.

    Restart PHP (the web server or PHP-FPM). To check Xdebug is loaded, open ACP > Modules > Core > System Core > Tools > System Check and click the PHP version: the PHP info page lists Xdebug.

  • In the editor

    1. Open the Jamroom folder as a project.
    2. Listen for debug connections on port 9003.
    3. If the site runs in a container or on a server, map the server's folder (for example /var/www/html) to your local copy.
    4. Set a breakpoint, for example on the return $_data; line of a listener, and load the page with the trigger.

    The editor stops at the breakpoint, with every variable to look at.

  • Without a debugger

    fdebug() writes any values to the Debug Log. See The Debug Log.

Tags