-
-
Save tylers-username/8923149702d4a796c5e103412c2370c3 to your computer and use it in GitHub Desktop.
Install Blackfire on Lando & Automatically Configure
This file contains hidden or 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
#### | |
## Blackfire config - `lando rebuild` required | |
#### | |
BLACKFIRE_CLIENT_ID=b5ee8ca3-****-****-****-5d227546a4c0 | |
BLACKFIRE_CLIENT_TOKEN=3a2b88cbfb*******************************22763 | |
BLACKFIRE_SERVER_ID=4b8ac335-****-****-****-b34439207732 | |
BLACKFIRE_SERVER_TOKEN=98f7fdf4b12b7**************************12b837cf080d |
This file contains hidden or 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
name: my-php-project | |
services: | |
appserver: | |
type: php:7.0 | |
via: nginx:1.13 | |
ssl: true | |
webroot: pub | |
config: | |
# This provides our Blackfire environment credentials to PHP | |
conf: php.ini | |
build_as_root: | |
# Path to blackfireInit.sh | |
- ./blackfireInit.sh | |
tooling: | |
blackfire: | |
service: appserver | |
user: root | |
blackfire-agent: | |
service: appserver | |
user: root | |
blackfire-agent:service: | |
description: Start/Stop/Restart Blackfire agent service | |
cmd: | |
- /etc/init.d/blackfire-agent | |
service: appserver | |
user: root |
This file contains hidden or 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
#!/usr/bin/env bash | |
# Configure Blackfire Repository | |
wget -q -O - https://packages.blackfire.io/gpg.key | apt-key add - | |
echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list | |
apt-get update | |
# Install Blackfire Agent | |
apt-get install blackfire-agent -y | |
printf "%s\n" $BLACKFIRE_CLIENT_ID $BLACKFIRE_CLIENT_TOKEN | blackfire config | |
# Start blackfire on-boot | |
/etc/init.d/blackfire-agent restart | |
# Install Blackfire Probe | |
version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") | |
curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version | |
tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp | |
mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so | |
# Enable Blackfire Probe | |
docker-php-ext-enable blackfire |
This file contains hidden or 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
# Blackfire Suggestions | |
[blackfire] | |
; Enterprise does not have the option to update Blackfire settings via .platform.app.yaml | |
; We're giving ourselves auto-update capabilities here | |
; Sets the socket where the agent is listening. | |
; Possible value can be a unix socket or a TCP address. | |
; Defaults to unix:///var/run/blackfire/agent.sock on Linux, | |
; unix:///usr/local/var/run/blackfire-agent.sock on MacOSX, | |
; and to tcp://127.0.0.1:8307 on Windows. | |
; blackfire.agent_socket = unix:///var/run/blackfire/agent.sock | |
; Log verbosity level (4: debug, 3: info, 2: warning, 1: error) | |
; blackfire.log_level = 4 | |
; Log file (STDERR by default) | |
; blackfire.log_file = "${LANDO_MOUNT}"/log/blackfire.log | |
; Sets fine-grained configuration for Probe. | |
; This should be left blank in most cases. For most installs, | |
; the server credentials should only be set in the agent. | |
blackfire.server_id="${BLACKFIRE_SERVER_ID}" | |
; Sets fine-grained configuration for Probe. | |
; This should be left blank in most cases. For most installs, | |
; the server credentials should only be set in the agent. | |
blackfire.server_token="${BLACKFIRE_SERVER_TOKEN}" |
My pleasure ๐.
Feel free to report any issue in the Github repo. Feedback appreciated ๐
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wow, perfect timing, just started searching and found this, thank you.