Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

linux dot utility (with xhprof)

i installed the xhprof profiling extension for php

Everything is fine except for the callgraph.php file, it returns: failed to shell execute cmd=" dot -Tpng"

so i checked and the dot utility wasn't installed, so i installed it.

it appears to be running fine from the command line so i ran the scritp again, same error: failed to shell execute cmd=" dot -Tpng"

the xhprof documentation states: the callgraph image visualization ([View Callgraph]) feature relies on the presence of Graphviz "dot" utility in your path.

but i don't understand what i need to do now, specifically the "utility in your path" part

Any help appreciated, thanks guys

like image 820
mononym Avatar asked May 28 '10 15:05

mononym


3 Answers

If you want graphing functions for xhprof run next command in terminal:

sudo apt-get install graphviz
like image 149
milkovsky Avatar answered Oct 14 '22 08:10

milkovsky


When I enable error_reporting, I see there are some configuration variable are missing:

function xhprof_generate_image_by_dot($dot_script, $type) {
  // get config => yep really dirty - but unobstrusive
  global $_xhprof;

  $errorFile    = $_xhprof['dot_errfile'];
  $tmpDirectory = $_xhprof['dot_tempdir'];
  $dotBinary    = $_xhprof['dot_binary'];

After add the following lines to xhprof_lib/config.php, it works

$_xhprof['dot_errfile'] = '/home/peniel/var/log/xhprof/error.log';
$_xhprof['dot_tempdir'] = '/home/peniel/var/log/xhprof';
$_xhprof['dot_binary'] = '/usr/bin/dot';
like image 28
Peniel1127 Avatar answered Oct 14 '22 06:10

Peniel1127


If you have installed graphviz this error also will occure because of the security restrictions. Some functions may be disabled. So, see your logs for some php warnings.

For example:

PHP Warning:  proc_open() has been disabled for security reasons in /usr/share/php/xhprof_lib/utils/callgraph_utils.php on line 112

You need to configure php.ini or security.ini parameter "disable_functions".

like image 34
Volodymyr Chumak Avatar answered Oct 14 '22 08:10

Volodymyr Chumak