DDEV

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

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

The Blackfire probe is installed by default and the agent is added as an additional service. It can be configured globally with this command:

Loading...

The credentials can be configured for a specific project by updating its DDEV config file located in .ddev/config.yaml:

Loading...
1
Loading...

To activate Blackfire after every ddev restart, run the following command:

1
Loading...

To activate Blackfire every time your project starts, in the .ddev/config.yml file of your DDEV project, define a custom hook similar to:

1
2
3
4
5
Loading...

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):
1
Loading...
  • Verify if Blackfire is currently enabled, as well as the currently installed: Blackfire Probe version.
1
Loading...

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

When using ddev exec blackfire curl http://127.0.0.1, there is no need to specify a DDEV external port as you are already executing it in a DDEV context. Additional documentation is provided by ddev-contrib.

Blackfire Player can be used in your DDEV project to trigger automated performance tests or crawl information.

DDEV support custom commands enriching its standard behavior. Let's setup a ddev player command for a project by creating it configuration file .ddev/commands/host/player with this content:

Loading...