cd ~/Projects
git clone https://github.com/facebook/xhprof.git xhprof.YOURDOMAIN
cd xhprof.YOURDOMAIN/extension
phpize
CFLAGS="-arch x86_64 -arch i386"
./configure
make
sudo make install
There is an issue with timers, see https://github.com/facebook/xhprof/commit/b7b4ad7d1b72803fa8235e988d6cbf93d80ed59d#L2R276 You can confirm this by running:
make test
Make the web interface available by aliasing it to public_html:
cd ..
ln -s xhprof_html public_html
```
## 2. Now add the xhprof extension to /etc/php.ini:
```ini
[xhprof]
extension=xhprof.so
xhprof.output_dir=/private/tmp
```
## 3. Restart Apache and double-check that the xhprof extension is properly loading
```bash
sudo apachectl restart
php -m | grep xhprof
```
## 4. Add this to devel settings (replace USER with your username):
xhprof directory:
/Users/USER/Projects/xhprof.YOURDOMAIN
XHProf URL:
http://xhprof.YOURDOMAIN
## 5. To be able to generate callgraphs:
```bash
brew install graphviz
```
See http://xhprof.YOURDOMAIN/docs for documentation on using XHProf