Xdebug profiler - Incorrect profiler snapshot format

1.8k Views Asked by At

I'm trying to open xdebug profiler output in PhpStorm, but I'm getting an error:

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

I can't seem to find any indication as to what could be causing this.

I'm on OSX 10.13.4, PhpStorm version 2018.1, running the process on PHP 5.6.33 with xdebug 2.5.5

Here's my php.ini configuration:

[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

The profiler output looks a bit weird I think, for example:

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

I don't know what those numbers in parenthesis are there for, but I think this is what's tripping PhpStorm's analyser.

2

There are 2 best solutions below

5
Alessandro.Vegna On

This is my configuration give it a try:

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 settings: enter image description here

And remember to enable the listening in phpstorm:

enter image description here

2
Nicolas On

I think I found the source of the issue, or at least part of it. It looks like it has to do with the script itself. Hard to tell why exactly, maybe because it spins up a daemon process and that could potentially mess with the profiler, not sure. But if I run the profiler on something else it works.