DDEV

DDEV is a development platform for PHP based on Docker containers (DDEV-Local).

DDEV-Local

You must use version 1.17 or above of DDEV-local. Their documentation offers detailed procedures for most OSes.

  1. The Blackfire probe is installed by default and the agent is added as an additional service that should be configured with this command:

or to display your Blackfire's credentials.

ddev config global \
    --web-environment="BLACKFIRE_SERVER_ID=<YOUR_BLACKFIRE_SERVER_ID>, \
        BLACKFIRE_SERVER_TOKEN=<YOUR_BLACKFIRE_SERVER_TOKEN>, \
        BLACKFIRE_CLIENT_ID=<YOUR_BLACKFIRE_CLIENT_ID>, \
        BLACKFIRE_CLIENT_TOKEN=<YOUR_BLACKFIRE_CLIENT_TOKEN>"
  1. Restart DDEV:
1
ddev restart
  1. Activate Blackfire:
1
ddev blackfire on

You may have to run ddev blackfire on after every ddev restart.

Additional commands:

  • Disable the Blackfire Probe and stops the Blackfire agent (this can be useful if you need to run xdebug, which is deactivated when you start Blackfire with ddev blackfire on):
1
ddev blackfire off
  • Verify if Blackfire is currently enabled, as well as the currently installed: Blackfire Probe version.
1
ddev blackfire status

You can now profile requests with all available methods. When profiling with the CLI, prefix the blackfire commands with ddev exec:

  • ddev exec blackfire curl https://foobar.ddev.site
  • ddev exec blackfire drush st

Note

Additional documentation is provided by ddev-contrib.