Debugging for console seems not to work properly


At the moment, i am experiencing a very strange behaviour.
Debugging console commands is not possible at all, the breakpoint does not hit.

What i tried to do:

  1. Setting a breakpoint in DataImportBusinessFactory on line 328 ($dataSetStepBroker->addStep …) in my IntelliJ/PhpStorm IDE (under MacOS)

  2. Executing

vendor/bin/console data:import:product-concrete

from command line in vagrant vm.


  • Breakpoint stops at line 328
  • variable $dataSetStepBroker is initialized (done one line before according to source code with dataSetStepBroker = …)


  • Breakpoint stops at line 328
  • variable $dataSetStepBroker is not set until now
  • if i step over to line 329, the variable is now set (even tough there is not such an command to do this)
  • further steps more the debugger stops on an empty line

So obviously there is a bug synchronizing sourcecode between vm and local dev. The IntelliJ is always one step ahead the real debugging line.

I found out, that this affects all classes loaded by the autoloader in vendor/bin/console php file. The vendor/bin/console itself debugs proper. So maybe autloading/symlinks causes the problem?

Any ideas?

Best regards


Hi Jim!
You can try to add script to debug in PhpStorm:
go to Run -> Edit Configuration. Press plus and add new PHP Script.

And configure like this.
Than run this script with debug.

Best Regards,
Aleksey Kotsuba.


I haven’t experienced this behaviour before, but following the academy topic on this, never failed me. (the section of “Debugging Console Commands”)


Unfortunately same behaviour for local debugging setting :confused:


Do you also work with vagrant/intellij/MacOS? That would leaving me hopeful … i’ll try to start completely on a fresh installation


Yes, you are running the command from within the devvm, right?


Yes i do. But i also tried outside.


Ok i reinstalled the whole thing. Same behaviour for console commands.

In vm executing

XDEBUG_CONFIG=“remote_host=” PHP_IDE_CONFIG=“serverName=zed” vendor/bin/console data:import:product-concrete

Breakpoint set on line 328.

Result: Breakpoint stops but is factual in line 327.

Debugging via frontend works fine.

What else can i do?


I found out that only files from src/ folder are affected. All vendor code works and hits the correct line. just the existing code in src/ does not work properly. But only for command line executed PHP. My guess is, that the PHP_IDE_CONFIG=“serverName=zed” has no effect to the IDE … it does not matter if I write something like PHP_IDE_CONFIG=“serverName=zed” or PHP_IDE_CONFIG=“serverName=dfjkofkdfpmpmw” the result is still the same.

Okay, it just seems it works correct. If i set a breakpoint on the line which is shown in the stack, it will not stop here … this is really weird and frustrating

Edit 2:
Ok, only console.php works properly … all other files (included) don’t work properly.

Edit 3:
I duplicated the line “require_once SPRYKER_COMPOSER_INSTALL;” in console.php by mistake … but now the breakpoints seems to work properly.

I pressed cmd+z to undo these changes to track that this really issues the problem. But … the debugger still works correct.
Can somebody explain me this behavior? :thinking:

Edit 4:
The correct debugging behavior is gone again now, the debugger stops at the wrong line again … i can’t reproduce a working state. Duplicating the code line from edit above does not trigger the correct debugging behavior … :confused: