Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phungrk/83ccf90f15b33b91e5e8b48e163c3d58 to your computer and use it in GitHub Desktop.
Save phungrk/83ccf90f15b33b91e5e8b48e163c3d58 to your computer and use it in GitHub Desktop.
Installing XHProf for AMPPS and PHP 7.2 on Mac OS 10.13

Change directory

cd /Applications/AMPPS/www

Clone xhprof for PHP7.2

git clone https://github.com/longxinH/xhprof

Change dir

cd xhprof/extension

Install

phpize
CFLAGS="-arch i386" LDFLAGS="-arch i386" ./configure
make
make install

php-ini

Add at end of file:

/Applications/AMPPS/php-7.1/etc/php.ini

[xhprof]
extension="{$path}/php-7.1/lib/extensions/no-debug-non-zts-20160303/xhprof.so"
xhprof.output_dir=/tmp/xhprof

Check

http://localhost/cgi-bin/phpinfo.cgi

Install WP plugin

https://wordpress.org/plugins/wp-xhprof-profiler/

(Restart Apache if Plugin can not load xhprof extension.

Install graphviz to visualize callgraph

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