Last active
May 5, 2023 11:40
-
-
Save pascalbaljet/4e01100bb8b00944acf4 to your computer and use it in GitHub Desktop.
Install Blackfire on Debian/Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
2023 update, from: https://blackfire.io/docs/up-and-running/installation?action=install&mode=full&location=server&os=debian&language=php