When using a PHP different than the one shipped with macOS, please ensure the php binary from your PATH is the one you want to use Blackfire on. For example if you are using MAMP, when you run
which php
, the path returned should mention MAMP.
which php
# /usr/bin/php
nano ~/.bash_profile
export PATH=/Applications/MAMP/bin/php/php7.4.2/bin:$PATH
source ~/.bash_profile
which php
# /Applications/MAMP/bin/php/php7.4.2/bin/php
echo $PATH
PATH contains PHP 7.4.2
Then https://blog.liplex.de/blackfire-setup-with-mamp-pro/
brew install blackfire-php74 --without-homebrew-php
Error: Version of PHP (73) in $PATH does not support this extension version (74). Consider installing blackfire-php-73 with the
--without-homebrew-php
flag.
brew install blackfire-php73 --without-homebrew-php
Create phpinfo()
in info.php in WordPress site root (local dev only) - Blackfire extension does not appear..
Tried:
# destination path can be found via phpinfo() - extension_dir
cp blackfire.so /Applications/MAMP/bin/php/php7.4.2/lib/php/extensions/no-debug-non-zts-20190902/blackfire.so
MAMP > PHP > Make this version available on the command line: check
php --ri blackfire # Extension 'blackfire' not present.
Change MAMP's default version of PHP to 7.3.9
Update the php.ini
file as instructed by Blackfire in the console output from brew install
php --ri blackfire # Extension 'blackfire' not present.
But phpinfo()
shows:
blackfire
Blackfire enabled
Blackfire 1.31.0~mac-x64-non_zts73
Timing measurement cgt
Sessions support enabled
Num of CPU 12
Profiling heap memory 0 Kb
Main instance trigger mode HTTP header triggered
Main instance disabled
Run Chrome Blackfire extension on local website (logged out of WP Admin).
Profiler graph generated.