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 that. It could be configured globally with this command:
or Sign Up 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>"
The credentials can be configured for a specific project only by updating its
DDEV config file
located in .ddev/config.yaml
:
or Sign Up to display your Blackfire's credentials.
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 | ddev restart
|
1 | ddev blackfire on |
You may have to run ddev blackfire on
after every ddev restart
.
Additional commands:
ddev blackfire on
):1 | ddev blackfire off |
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
When using ddev exec blackfire curl http://127.0.0.1
, no need of DDEV external port as you are already executing it in a DDEV context.
Additional documentation is provided by ddev-contrib.