Skip to content

Instantly share code, notes, and snippets.

@pascalbaljet
Last active May 5, 2023 11:40
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pascalbaljet/4e01100bb8b00944acf4 to your computer and use it in GitHub Desktop.
Save pascalbaljet/4e01100bb8b00944acf4 to your computer and use it in GitHub Desktop.
Install Blackfire on Debian/Ubuntu
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# Register the packagecloud key
wget -O - https://packagecloud.io/gpg.key | sudo apt-key add -
# Add deb http://packages.blackfire.io/debian any main to /etc/apt/sources.list.d/blackfire.list
echo "deb http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list
# Update the repositories
apt-get update
# Install the blackfire-agent package and install the PHP Probe
apt-get install blackfire-agent blackfire-php -y
# Configure your Blackfire credentials
blackfire-agent -register
# Restart the service
/etc/init.d/blackfire-agent restart
# Initialize the client
blackfire config
echo extension=/usr/lib/blackfire-php/amd64/blackfire-20151012.so >> /etc/php/7.0/cli/php.ini
echo extension=/usr/lib/blackfire-php/amd64/blackfire-20151012.so >> /etc/php/7.0/fpm/php.ini
# Restart some services
service php7.0-fpm restart
service nginx restart
@pascalbaljet
Copy link
Author

@williamdes
Copy link

2023 update, from: https://blackfire.io/docs/up-and-running/installation?action=install&mode=full&location=server&os=debian&language=php

wget -q -O - https://packages.blackfire.io/gpg.key | sudo dd of=/usr/share/keyrings/blackfire-archive-keyring.asc 

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/blackfire-archive-keyring.asc] http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list 

sudo apt update
sudo apt install blackfire
sudo apt install blackfire-php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment