首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GUI中的XHPROF错误。ID为"-1“。

GUI中的XHPROF错误。ID为"-1“。
EN

Stack Overflow用户
提问于 2012-06-14 07:56:12
回答 1查看 1K关注 0票数 0

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

代码语言:javascript
复制
<? 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>";

到目前为止,没有什么特别之处,但是在xhprofGUI (有上面的链接)中,我得到了这个错误,id仍然是"-1":

代码语言:javascript
复制
Warning: gzuncompress () [ function.gzuncompress]: data error in D: \ wamp \ offline-shared \ includes \ xhprof \ git \ xhprof \ xhprof_lib \ utils \ xhprof_runs.php on line 278
Given XHProf Run not found.

如果我通过一个带有警告的虚拟主机传递而不是,我就会得到这个错误:

代码语言:javascript
复制
Run Report
    Run # -1: Invalid Run Id = -1

一个主意?谢谢法布里斯

EN

回答 1

Stack Overflow用户

发布于 2012-06-15 08:46:14

不,php代码是正确的。我找到了答案。是错误的。您必须使用位于"Pdo.php“文件中的文件。

所以,一切都很好:)

法布里斯

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11028930

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档