Wednesday, May 29, 2013

Using XHProf for Drupal

I choose to download from source and compile XHProf.
Go to XHProf github and download the source.
cd ~
wget https://github.com/facebook/xhprof/archive/master.zip
unzip master.zip
cd xhprof-master/extension/
phpize
./configure
make
make test
sudo make install
In php.ini
[xhprof]
extension=xhprof.so
xhprof.output_dir="/tmp/xhprof"
Manually create the XHProf output directory if it doesn't exists. Restart server
sudo service apache2 restart
Link to XHProf html. Remember to create and enable xhprof.dev from Apache and hosts file.
cd /var/wwww
ln -s ~/xhprof-master/xhprof_html xhprof.dev
Go to your Drupal devel admin configuration /admin/config/development/devel and enable XHProf
xhprof directory = /home/jewei/xhprof-master
XHProf URL = http://xhprof.dev
You might want to get graphviz for Callgraph.
sudo apt-get install graphviz

Alternatives:

Drupal project: XHProf

No comments: