Installing and updating Blackfire should be a quick process. This document will guide you through the steps.
For a better experience, you should or Sign Up.
Tell us what you want to do:
The v2
version is the one you want to use. If you have
automation based on the previous version, select v1
, which is still
supported until the Aug, 31th 2021.
If you are upgrading from v1, please read the upgrade guide.
To start using Blackfire, we are going to install the following:
If you need to install the Blackfire stack manually because every other
installation methods failed, please contact
us and mention your platform, language type, and language version.
In the meantime, use the following steps for manual installation.
You are strongly advised to use the other installation methods available if possible as they give you seamless upgrade methods.
blackfire
file to a directory in
your path (e.g. /usr/local/bin
) and make the file
executable.
This command asks for some Blackfire server credentials, log in or sign up now to get them:
or Sign Up
Learn more about the agent configuration file.
You can manually launch the agent each time you want to profile a page
or a script by using blackfire agent:start
, but it is better to
register a service in order to have it launched automatically.
Please refer to your OS documentation to determine how to register a service
(eg. using systemd
, init.d
, upstart
or
launchtl
.)
/var/log/blackfire/agent.log
. Change the log file or the log level in the
agent configuration file.
php -i | grep 'extension_dir'
When using a PHP different than the one shipped with macOS, please
ensure the php
binary from your PATH
is the one you want
to use Blackfire on.
For example if you are using MAMP on macOS, when you run
which php
, the path returned should mention MAMP.
Please also note you may have to edit two php.ini
files,
one for the web and one for the command line.
For MAMP Pro users, please note that you should not directly edit
the php.ini
file used in web mode. Instead you need to edit the template
from the MAMP Pro interface.
blackfire-*.so
(blackfire-*.dll
for Windows) file to this directory.
On Linux systems, check that the /var/run/blackfire/
directory exists and is accessible by both the Agent and the Probe.
For macOS users, check that the /usr/local/var/run/
directory exists and is accessible by both the Agent and the Probe.
PHP will likely crash when Blackfire is used when one of the following
extensions is also enabled: XHProf
, Pinba
, and
Suhosin
.
If XDebug
is installed, the PHP engine may not behave as
expected; consider disabling it when profiling.
If pcov
extension is installed, Blackfire will not
behave as expected; consider disabling it when profiling.
You can now enable monitoring for your environments.
To profile applications, you need to use a profiling client:
Profile from a browser via our browser extensions (Web applications only).
Profile from the command line via the blackfire
tool
(Web applications, APIs, command line tools, daemons, and more).
Configure it with your personal credentials:
blackfire client:config --client-id=CLIENT_ID --client-token=CLIENT_TOKEN
Start profiling via: