Blackfire is a PHP profiler that helps you analyse the performance of your code. It's a paid service, but you can get a free trial at blackfire.io.
We only support PHP 8.1+ for Blackfire. The extension is disabled by default.
Blackfire works by profiling your code as it runs.
A PHP extension must be installed into your PHP container. While the code is running, the PHP extension sends the profiling data to the (local) Blackfire agent container. The agent container processes the data and uploads it to the Blackfire.io website (where you can view the results).
- Edit your
.env
file- Fill in all Blackfire environment variables
- Enable the agent container by adding
opt/blackfire.yml
to theCOMPOSE_FILE
list
- Enable the Blackfire extension for PHP:
# Choose the PHP version you want
devin 83
debug --enable blackfire
exit
docker-compose restart
Similar to above. Simply run "debug --disable-all":
# Choose the PHP version you want
devin 83
debug --disable-all
exit
docker-compose restart
Make sure you've enabled the Blackfire extension for PHP as per the instructions above. You can confirm it's enabled by using phpinfo()
in your browser.
- Sign into blackfire.io
- Install the Blackfire extension in your browser. Here's one for Google Chrome
- Navigate to the site/page you'd like to profile
- Click the 'Profile' button in the Blackfire browser extension
- Check the Blackfire extension is installed in your PHP container. Use
phpinfo()
to confirm. - Check the Blackfire agent (container) is running. Use
docker compose ps
to confirm. - Check your Blackfire environment variables are correct in
.env
.
The Blackfire documentation should have the answers you are looking for.