PhpStorm xdebug won't debug

Answered

Hello,

 

I am learning php and use the PhpStorm IDE. In school we use XAMPP as server and xDebug as debug plugin. I have installed everything and i can "run" code but can't debug, when i start a session, the breakpoints seem to be ignored. There are some screenshot below.

Can someone help me please?

 




0
4 comments

(for reference purposes) The same asked on StackOverflow: http://stackoverflow.com/questions/42531902/phpstorm-xdebug-wont-debug

 

@Wim

Same as on SO:

1) Here is where to enable logging: xdebug.org/docs/all_settings#remote_log

2) After you do these changes -- restart Apache and verify with phpinfo() output that logging is enabled

3) Once confirmed -- try debugging.

4) When done -- share the generated xdebug log file.

0
Avatar
Permanently deleted user

xdebug_log:

Log opened at 2017-03-07 07:32:48
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///E:/xampp/htdocs/PHPStormProjects/test/index.php" language="PHP" xdebug:language_version="5.6.1-dev" protocol_version="1.0" appid="4568" idekey="17172"><engine version="2.5.1"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2017 by Derick Rethans]]></copyright></init>

<- feature_set -i 1 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>

<- feature_set -i 2 -n max_depth -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response>

<- feature_set -i 3 -n max_children -v 100
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response>

<- status -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="4" status="starting" reason="ok"></response>

<- step_into -i 5
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="5" status="break" reason="ok"><xdebug:message filename="file:///E:/xampp/htdocs/PHPStormProjects/test/index.php" lineno="4"></xdebug:message></response>

<- stack_get -i 6
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="6"><stack where="{main}" level="0" type="file" filename="file:///E:/xampp/htdocs/PHPStormProjects/test/index.php" lineno="4"></stack></response>

<- run -i 7
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="7" status="stopping" reason="ok"></response>

<- run -i 8
Log closed at 2017-03-07 07:32:49

 

But i have done some searching myself and found that when I try to validate the debugger, it gives a 404. What could be the cause?
0

>xdebug_log:

From what I see IDE have not even tried to set the breakpoint. xdebug stopped at first code line  (the one with "$a = 1;") but IDE just said "run".

Possibly it's your settings somewhere (maybe added to the ignored list or something). Please try this:

  1. Close project in IDE
  2. Close IDE
  3. Go to PROJECT_ROOT and delete .idea subfolder (this projects settings)
  4. Launch IDE and from Welcome screen, tell choose "Open" and point to the PROJECT_ROOT -- IDE will create new fresh project from those files
  5. Configure and try to debug again (I recommend Zero-config approach: little to no initial config from IDE side -- just activate "phone handle" icon and init debug from the browser.)

You may also try just placing xdebug_break(); in your code (programmatic breakpoint) and see how it will behave this way.

>But i have done some searching myself and found that when I try to validate the debugger, it gives a 404. What could be the cause?

Have you configured Deployment for this project? Maybe you did it wrong .. so IDE checks for the verification script using wrong path. Please check your Apache log -- it should tell what url/file was attempted.

0
Avatar
Permanently deleted user

i don't know what did the trick but it now works.

I deleted the log of the xampp server and just started the whole thing up again maybe it was something with the "Start debugger" in chrome.

Thanks
Wim

0

Please sign in to leave a comment.