Skip to main content

Symfony dump server output in a browser tab

Instead of running bin/console server:dump in a terminal, use Buggregator as the dump server. Set VAR_DUMPER_FORMAT=server and VAR_DUMPER_SERVER=127.0.0.1:9912 in .env.local. Every dump() then shows up in a browser tab as a tree you can fold, with the file and line it came from. Your page and your JSON responses stay clean.

Steps

1. Start Buggregator

Port 8000 is the UI, port 9912 takes the dumps.

bash
docker run --pull always \
  -p 127.0.0.1:8000:8000 \
  -p 127.0.0.1:9912:9912 \
  ghcr.io/buggregator/server:latest

2. Set two lines in .env.local

In Docker Compose, use the service name: VAR_DUMPER_SERVER=buggregator:9912.

dotenv
VAR_DUMPER_FORMAT=server
VAR_DUMPER_SERVER=127.0.0.1:9912

You do not run server:dump. Buggregator listens on port 9912 in its place.

3. Or use the debug bundle's setting

If you use symfony/debug-bundle, its recipe adds config/packages/debug.yaml with a dump destination that reads VAR_DUMPER_SERVER. Then set only VAR_DUMPER_SERVER.

yaml
when@dev:
    debug:
        dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%"

4. Call dump() as usual

Open http://127.0.0.1:8000. Each dump shows the value as an expandable tree, its label if you gave one, and the source location. Click the location to open the file in your editor. This also works in commands, Messenger workers and other long-running processes.

Why it works

With VAR_DUMPER_FORMAT=server, VarDumper sends each dump over TCP to VAR_DUMPER_SERVER instead of printing it. The variable also keeps the debug bundle from replacing that handler, so dumps go to Buggregator and not into the page. Buggregator renders what arrives on port 9912. On the Windows binary, the VarDumper module is not available.

Checked on with Buggregator v2.13.0

Setup in 60 seconds

No registration. No account. Start it and point your app at it.

1

Start Buggregator

One file, installed with one command. The web UI opens on port 8000. Prefer containers? Use the Docker tab.

$ curl -fsSL https://raw.githubusercontent.com/buggregator/server/master/scripts/install.sh | sh
$ HTTP_ADDR=127.0.0.1:8000 \
  SMTP_ADDR=127.0.0.1:1025 \
  VAR_DUMPER_ADDR=127.0.0.1:9912 \
  MONOLOG_ADDR=127.0.0.1:9913 \
  PROXY_ADDR=127.0.0.1:8080 \
  ~/.local/bin/buggregator

The script picks the file for your CPU: Intel/AMD or ARM.

One file for Linux, macOS and Windows, about 40 MB. Nothing else to install.

This run line keeps it on this computer. Without the *_ADDR settings it listens on all network interfaces

Rather not run a script? Download the file yourself

Runs on Windows, macOS and Linux, on Intel/AMD and ARM.

Prefer not to do it yourself? Your AI agent can set Buggregator up for you