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's composer.json file:

1
composer require ext-blackfire

Configure the Blackfire credentials from your project root directory:

To auto-fill server credentials in the command below, log in first

heroku config:set BLACKFIRE_SERVER_ID=SERVER-ID
heroku config:set BLACKFIRE_SERVER_TOKEN=SERVER-TOKEN

Profile using the regular Blackfire CLI tools or a browser (Firefox or Chrome).

Note

If your app spans across 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).