
ddev-php-dumper
What is ddev-php-dumper?
“ddev-php-dumper” is a helper addon that redirects Symfony dump output to a server. Dumped data will no longer display inline on your site, but instead, be displayed in the terminal (var-dumper-server) or PHP Dumper, a Desktop Docker extension.
Using PHP Dumper offers several benefits:
- auto-expand dumps to a specific level
- filter dumps by time frame
- pin dumps
- compare 2 dump

What does this add-on do?
- Sets environment variables to redirect “var_dump” output to PHP Dumper Docker extention.
- Includes helper function to start a PHP dump server.
- Adds Docker host as an extra host in the web container.
Requirements
If you project is based on Symfony (such as Laravel, Drupal), it may already include ‘var-dumper’.
Installation
-
Install var-dumper, if you project does not already include it.
composer require --dev symfony/var-dumper
-
Install ddev-php-dump addon and restart to activate the addon.
For DDEV v1.23.5 or above run
ddev add-on get tyler36/ddev-php-dumper
For earlier versions of DDEV run
ddev get tyler36/ddev-php-dumper
Then restart your project
Next, you need to decide what dump server to use.
Docker “PHP Dump” setup
Requirements:
-
Install the PHP Dumper extension via Docker Desktop GUI or using the following command.
docker extension install artifision/php-dumper-docker-extension:latest
-
Create or update ./.ddev/.env
with:
VAR_DUMPER_SERVER="host.docker.internal"
-
Restart DDEV
-
Open PHP-dumper panel in Docker Desktop.
Example output:

Troubleshooting
Visit the test page, http://localhost:9913/dump to check if the extension can correctly receive data.
“var-dump server” setup
-
Open a terminal window and to start the dump server.
-
The server should start and be listening on tcp://localhost:9912

Using a dump()
command in your project will display the output.
Example output:

Usage
- Use
dump()
the command in your project.
The output will be redirect and displayed in your configured server.
Disable the service
To disable the service:
ddev service disable php-dumper
ddev restart
To re-enable the service:
ddev service enable php-dumper
ddev restart
Reference
For more information, see The Dump Server.
Contributed and maintained by @tyler36