Xdebug Local CLI Configuration (does'nt stop at breakpoint)

Hello there,

I'm having an hard time trying to configure xdebug & phpstorm for debugging local CLI application:

1) Is it necessary that i configure the CLI php with an apache one (e.g. from WAMP) to run? So far PHPUnit Test work with a 'simple' php interpreter.

2) Given i'm not forced to configure a 'localhost' what i have to do to got a simple CLI debugging session on local?

I've configured xdebug for php : i got Xdebug v.2.7.0 beta1 when i php -v and it's also recognized in the menu of phpstorm CLI interpreters :

However, (as you may see) i have'nt set up the debugger extension in "additional" menu from CLI interpreters because else the phpstorm console warn me that xdebug cannot load because it is already loaded.

I also added :"-d xdebug.idekey=blacktie" in the configurations options, and xdebug.idekey="blacktie" in the php.ini

When i start a debugger session, it does stop at first line as an option i checked in, show correctly variable and such, however it skip any break point that exist :(((.

Does anyone know what the problem may be please?

Next i would like to setup xdebug on a remote server but considering i can't get it to work on a simple CLI cmd ... :(

 

5 comments

Is it necessary that i configure the CLI php with an apache one (e.g. from WAMP) to run?

No, it's not. You can go ahead with any interpreter you like as long as Xdebug is installed there.

Given i'm not forced to configure a 'localhost' what i have to do to got a simple CLI debugging session on local?

Pretty much nothing, you already have it all. The question is why it ignores your breakpoints.

Please purge all Xdebug-related configuration from your php.ini leaving only zend_extension=path-to-xdebug intact.

Please also remove all additional parameters you set for the PHP interpreter in PhpStorm (including idekey), they are not needed.

Then, disable Run | Break at first line in PHP scripts, create a file as simple as:

<?php
$a = 1;
$a++;

...place a breakpoint onto line 2 and try to debug it. Would it also not stop?

0

Well it stop at the first line, but not on the next, and if i set up something like

<?php
$a=1;
$a++;
$a++;

With breakpoint on everyline but on the first one, it won't stop at all (continue is grey, only pause and stop are clickable.

0

OK, caught it as well. Apparently, 2.7.0beta1 is broken in some way. Please try using 2.6.1 instead.

0

I should've taken a look in the logs. It's this one: https://youtrack.jetbrains.com/issue/WI-43622

Using 2.6.1 is a workaround for now.

0

Yep it work now!

Many thanks :)

 

0

Please sign in to leave a comment.