Generating Callgraph with XHGUI

I had a frustrating bug the other day with a new XHGUI install, I am working on creating a VM for my new PHP tools course I am teaching in March and I wanted to pre-install and part-install a bunch of things so that I can show some great tools in a limited amount of time. My XHGUI wasn’t quite right though; it couldn’t generate the callgraph for me. Instead, it said:

failed to shell execute cmd=" "" -Tpng"

I was pretty confident that this should have been running dot; I do a bit with graphviz and that -T looks very dot-like. I installed the graphviz package for ubuntu but didn’t get any further, and google didn’t throw up any error messages that looked like this one, mostly people had broken dot commands and mine worked fine.

Further investigation showed that I needed to uncomment the relevant lines from the config file:

//These are good for linux and its derivatives.
$_xhprof['dot_binary']  = '/usr/bin/dot';
$_xhprof['dot_tempdir'] = '/tmp';
$_xhprof['dot_errfile'] = '/tmp/xh_dot.err';

I didn’t edit the lines, these just worked on my system … once I realised I needed them! Hope this helps someone else, I have always liked XHProf and XHGUI wraps it up into a complete package – many thanks to its creator, Paul Reinheimer for making this so easy for normal people to use!

4 thoughts on “Generating Callgraph with XHGUI

  1. Pingback: PHP Master | The Need for Speed: Profiling with XHProf and XHGui

  2. Pingback: The Need for Speed: Profiling PHP with XHProf and XHGui — SitePoint

Leave a Reply

Please use [code] and [/code] around any source code you wish to share.

This site uses Akismet to reduce spam. Learn how your comment data is processed.