If your project is hosted on a server infrastructure that uses WHM/cPanel, integration with Blackfire is possible by following this chapter's instructions.
Before starting, check with your provider that the Blackfire stack is installed and enabled on the server. If not, follow the administrator procedure or ask your provider to do so.
Then, follow the user procedure if you want to use different sets of credentials per website.
If Blackfire is not installed on the server, provide a link to the administrator documentation.
To configure Blackfire for EasyApache 4, go to the MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor), switch to "Editor Mode", select the proper domain and then copy/paste/adapt to your needs the following snippet:
1 2 3 4 5
[blackfire] ; Adapt the following credentials using the ones found on ; https://blackfire.io/dashboard/mine/settings or your environment settings. blackfire.server_id=e0b30241-a25d-4162-9ebb-329f784f1fc7 blackfire.server_token=3ac2260e038f138a5bca515b72c0205117d886777cf6472b14beabb704e06aa1
To configure Blackfire for EasyApache 3, define some environment variables by
creating or editing the
.htaccess file in the project's document root:
1 2 3 4 5 6
<IfModule mod_env.c> # Adapt the following credentials using the one found on # https://blackfire.io/dashboard/mine/settings or your environment settings. SetEnv BLACKFIRE_SERVER_ID e0b30241-a25d-4162-9ebb-329f784f1fc7 SetEnv BLACKFIRE_SERVER_TOKEN 3ac2260e038f138a5bca515b72c0205117d886777cf6472b14beabb704e06aa1 </IfModule>
If Blackfire has been installed but not enabled for all users, enable
it by creating a custom
php.ini configuration file.
php.ini file in your home directory, copy/paste the
content of the default PHP configuration (usually found at
/usr/local/lib/php.ini) and append the following content:
1 2 3
[blackfire] ; Only required if Blackfire is not loaded for all websites extension=blackfire.so
.htaccess to use the custom
php.ini file by adding the
1 2 3
<IfModule mod_suphp.c> suPHP_ConfigPath /home/<myuser>/php.ini </IfModule>
Some of these steps may not be allowed by your provider. In such case, contact its support and ask for the configuration by pointing at this documentation.
As a cPanel administrator, to provide the Blackfire stack to your users, install the Agent and the Probe.
To install the stack you will first need to create an account on Blackfire.io if you don't have one yet. It takes less than a minute if you already have a GitHub or Google+ account.
Then follow the installation instructions for RedHat based distributions.
To enable Blackfire for your users, go to the PHP Configuration Editor,
switch to "Advanced Mode" and add
blackfire.so to the
Blackfire should have been automatically enabled by our Redhat package. You can
check by running
/opt/cpanel/ea-php56/root/usr/bin/php --ri blackfire
(tweak to match the installed PHP versions).
Next, allow your users to add Blackfire settings to their
/usr/local/cpanel/whostmgr/etc/phpini_directives.yaml and append the
following snippet at the end of the file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
blackfire.server_id: changeable: PHP_INI_ALL default: NULL multiple: 0 note: 'Blackfire probe Server ID' section: 'blackfire' type: string blackfire.server_token: changeable: PHP_INI_ALL default: NULL multiple: 0 note: 'Blackfire probe Server Token' section: 'blackfire' type: string blackfire.log_level: changeable: PHP_INI_ALL default: 1 multiple: 0 note: 'Blackfire probe log verbosity level' section: 'blackfire' type: integer blackfire.log_file: changeable: PHP_INI_ALL default: NULL multiple: 0 note: 'Blackfire probe log destination file' section: 'blackfire' type: string blackfire.agent_timeout: changeable: PHP_INI_ALL default: 0.25 multiple: 0 note: '' section: 'blackfire' type: float
Currently, because of a cPanel limitation, this last step must be repeated on every cPanel upgrade.
cPanel is aware of this limitation and we are currently in discussion with their team to smooth this experience in the near future.