Skip to content

Instantly share code, notes, and snippets.

@Lemmings19
Created April 13, 2017 22:41
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lemmings19/50c8c3a83c348315daa0140c62ca0588 to your computer and use it in GitHub Desktop.
Save Lemmings19/50c8c3a83c348315daa0140c62ca0588 to your computer and use it in GitHub Desktop.
Blackfire OSX MAMP setup:

Look for the 'manual' tab here: https://blackfire.io/docs/24-days/06-installation#installation-on-your-local-computers

I just installed your tools on OSX using MAMP Pro and have some feedback. The installation wasn't very straightforward.

The documentation provided was perfect for the agent and the CLI tools. But, it fell quite short for the probe installation: https://blackfire.io/docs/up-and-running/installation#install-probe-osx

There is a clause for MAMP/MAMP Pro in there, but it doesn't provide any direction. It notes to check your PHP using which php, and that you'll have to modify one or two php.ini files, but doesn't provide instructions for why, how, or what needs to be modified.

brew install blackfire-php71 --without-brew-php didn't seem to integrate with MAMP.

I have it up and running now, and will provide the process I followed in case it helps. You may want to update your docs if it makes sense to.

Here's what I did:

  • Followed the brew installation process so that I could download the PHP extension (not sure where else to get it).

brew install blackfire-php56

  • Checked where brew downloaded the extension to so that I could copy it over to my MAMP (or other) PHP installation:

brew info blackfire-php71

  • This pointed me to: /usr/local/Cellar/blackfire-php71/1.16.1

  • Checked where MAMP's PHP installation was:

which php

  • This pointed me to: /Applications/MAMP/bin/php/php7.1.0/bin/php

  • Copied over the extension I downloaded with Brew:

cp /usr/local/Cellar/blackfire-php71/1.16.1/blackfire.so /Applications/MAMP/bin/php/php7.1.0/lib/php/extensions/no-debug-non-zts-20160303

  • Checked PHP's ini location:

php --ini

[blackfire] ;Replace the path with the path of the folder where you downloaded the probe extension="/Applications/MAMP/bin/php/php5.5.10/lib/php/extensions/no-debug-non-zts-20121212/blackfire-php-darwin_amd64-php-55.so"

; On Linux systems, uncomment the following line ;blackfire.agent_socket = unix:///var/run/blackfire/agent.sock ; On Mac OS X systems, uncomment the following line blackfire.agent_socket = unix:///usr/local/var/run/blackfire-agent.sock

blackfire.agent_timeout = 0.25

; Log verbosity level (4: debug, 3: info, 2: warning, 1: error) blackfire.log_level = 4

; Log file blackfire.log_file = /usr/local/var/log/blackfire/blackfire.log

blackfire.server_id = YOUR_SERVER_ID

blackfire.server_token = YOUR_SERVER_TOKEN

  • Restarted Apache: (restart would've been fine I'm sure)

sudo apachectl stop sudo apachectl start

  • Was then able to verify the extension's presence:

php --ri blackfire

The main problems here were:

  • Not sure how to download the probe extension outside of brew.
  • Not sure where to find the php.ini configuration/instructions.
  • Instructions in this section are misleading and do not work.

...

I am just now seeing that there is a 'Manual' section peppered in with the operating systems tabs under installation.

@NicolasHalberstadt
Copy link

NicolasHalberstadt commented Aug 16, 2021

Hi!
Quite old installation tutorial but thanks ! It helped me a lot !
Cheers

@Lemmings19
Copy link
Author

Lemmings19 commented Aug 23, 2021

@NicolasHalberstadt Good stuff, happy to hear it helped out.

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