Php GUI中的XHPROF错误。ID仍保留为"-1“;

Php GUI中的XHPROF错误。ID仍保留为"-1“;,php,xhprof,Php,Xhprof,我目前正在使用以下代码测试XHPROF(wamp,windows xp): <? Php xhprof_enable (XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY); function bar ($ x) { if ($ x> 0) { bar ($ x - 1); } } function foo () { for ($ idx = 0; $ idx <5; $ idx + +) { bar ($ idx);

我目前正在使用以下代码测试XHPROF(wamp,windows xp):

<? Php
xhprof_enable (XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY);

function bar ($ x) {
  if ($ x> 0) {
    bar ($ x - 1);
  }
}

function foo () {
  for ($ idx = 0; $ idx <5; $ idx + +) {
    bar ($ idx);
    $ X = strlen ("abc");
  }
}

/ / Run program
foo ();

/ / Stop profiling
= $ Xhprof_data xhprof_disable ();

/ / Display raw data xhprof for the profiling run
print_r ($ xhprof_data);


/ / $ XHPROF_ROOT = realpath (dirname (__FILE__). '/ ..');
XHPROF_ROOT $ = 'D: \ wamp \ offline-shared \ includes \ xhprof \ git \ xhprof';
/ / Include_once $ XHPROF_ROOT. "/ Xhprof_lib / utils / xhprof_lib.php";
/ / Include_once $ XHPROF_ROOT. "/ Xhprof_lib / utils / xhprof_runs.php";

Xhprof_root $ = 'D :/ wamp / offline-shared / includes / xhprof / git / xhprof /';
include_once $ xhprof_root. "Xhprof_lib / config.php";
include_once $ xhprof_root. "Xhprof_lib / utils / xhprof_lib.php";
include_once $ xhprof_root. "Xhprof_lib / utils / xhprof_runs.php";

/ / Save raw data for this profiling run using default
/ / Implementation of iXHProfRuns.
Xhprof_runs XHProfRuns_Default $ = new ();

/ / Save the run Under a namespace "xhprof_foo"
$ = $ Run_id xhprof_runs-> save_run ($ xhprof_data, "xhprof_foo");

echo "<a href='http://localhost/tests/xhprof/xhprof_html/index.php?run={$run_id}&source=xhprof_foo'> here </ a> topics:";
echo "<a href='http://xhprof-local/index.php?run={$run_id}&source=xhprof_foo'> and / or here </ a>";
如果我通过带有警告的虚拟主机传递not,则会出现此错误:

Run Report
    Run # -1: Invalid Run Id = -1
一个主意? 非常感谢。
Fabrice不,php代码是正确的。我找到了答案。sql创建语句错误。您必须使用位于“Pdo.php”文件中的文件

因此,一切都是好的:)


Fabrice

您的php代码似乎真的有问题:o
Run Report
    Run # -1: Invalid Run Id = -1