Heroku

Blackfire is part of the default Heroku PHP buildpack.

To enable Blackfire when using the PHP official Heroku buildpack, add it as a requirement in the project composer.json file:

1
composer require ext-blackfire

Configure the Blackfire credentials from your project root directory:

1
2
heroku config:set BLACKFIRE_SERVER_ID SERVER-ID
heroku config:set BLACKFIRE_SERVER_TOKEN SERVER-TOKEN

Profile using the regular Blackfire CLI tools or the Chrome Companion!

Note

You can also provision the Blackfire addon via the heroku addons:create command, but the setup is more complex without any real benefits. Read more on heroku.com.

Note

If your app spans accross several dynos you might have to turn on Session Affinity using the heroku features:enable http-session-affinity command so that only one dyno is profiled when aggregation is enabled (the default).