4

我正在尝试在 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 分析器跳闸的原因。

4

2 回答 2

2

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

于 2018-05-11T11:38:05.390 回答
0

这是我的配置试一试:

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 中启用监听:

在此处输入图像描述

于 2018-05-11T08:51:28.463 回答