【问题标题】:Xdebug profiler - Incorrect profiler snapshot formatXdebug 探查器 - 探查器快照格式不正确
【发布时间】:2018-05-11 08:40:57
【问题描述】:

我正在尝试在 PhpStorm 中打开 xdebug 分析器输出,但出现错误:

Incorrect profiler snapshot format 
For input string: "fl=(2)"

我似乎找不到任何可能导致此问题的迹象。

我使用的是 OSX 10.13.4,PhpStorm 版本 2018.1,使用 xdebug 2.5.5 在 PHP 5.6.33 上运行进程

这是我的 php.ini 配置:

[xdebug]
zend_extension=/usr/local/Cellar/php56/5.6.33_9/lib/php/xdebug.so
xdebug.profiler_enable=1
xdebug.profiler_output_dir=/tmp/debug/
xdebug.profiler_output_name=cachegrind.out.%c
xdebug.profiler_enable_trigger=1
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM

我认为探查器的输出看起来有点奇怪,例如:

fl=(2)
fn=(5) php::spl_autoload_call
23 80
cfl=(1)
cfn=(4)
calls=1 0 0
23 2045

我不知道括号中的这些数字是做什么用的,但我认为这就是 PhpStorm 分析器的问题。

【问题讨论】:

  • 请注意,我也尝试使用 xdebug 2.6 在 php 7.2.5 上运行并遇到同样的问题。

标签: php phpstorm xdebug xdebug-profiler


【解决方案1】:

我想我找到了问题的根源,或者至少找到了一部分。 看起来它与脚本本身有关。很难确切地说出为什么,可能是因为它启动了一个守护进程,并且可能会弄乱分析器,不确定。但如果我在其他东西上运行探查器,它就可以工作。

【讨论】:

  • 这是最可能的解释。
  • 在我的情况下,同样的问题是由调用外部 REST API 的函数引起的。在我注释掉函数后它起作用了。
【解决方案2】:

这是我的配置试试看:

zend_extension=/usr/lib/php5/20090626/xdebug.so
xdebug.idekey=PHPSTORM
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001
xdebug.remote_mode=req
xdebug.remote_autostart=0
xdebug.remote_connect_back=1
xdebug.remote_log = "/tmp/xdebug_cli.log"
xdebug.profiler_enable=1

PHPStorm 设置:

记得在phpstorm中开启监听:

【讨论】:

猜你喜欢
  • 2011-12-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-12-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多