Set Breakpoint won't work when program is running
I wrote a simple program like this :
****************************************************************
1 <?php
2
3 while(true)
4 {
5 $stop = "here";
6 sleep(1);
7 }
****************************************************************
I tried to start this program first, and then setted breakpoint to line 5.
But the breakpoint won't be reached.
Update my working environment:
-------------------------------------------------------------------------
PhpStorm Version: 6.0.2
Xdebug Version: 2.2.1
PHP version: 5.3.3
OS: CentOS 6.2
-------------------------------------------------------------------------
Thanks for the kindly help
请先登录再写评论。
Sorry that should I provide more further information?
Thanks for any suggestion and any help :)
What have you done in PhpStorm as well as on remote side to set it up for such remote debug?
Here is a blog post that described all the steps required, in case you have not seen it yet: http://blog.jetbrains.com/webide/2012/03/new-in-4-0-easier-debugging-of-remote-php-command-line-scripts/
Thanks for the reply.
Please let me clarify my problem again, I properbly miss the point.
Actually I can debug on the simple program if I set the breakpoint before execute the program.
But the breakpoint won't be reached anymore if I set the brakpoint after program be executed.
In this case I will not be able to help you much -- I'm not a dev and do not do any of such remote CLI debug myself (don't even have an environment to test).
My only suggestion:
Thank you again, I jsut tried another test.
Debug this simple program on local machine.
It still only work if breakpoints be setted before program start.
Thanks for the remind, I tried to find anything useful on the debug logs.
And I found xdebug's log won't be logged an event like 'breakpoint_set ......' if the program is running.
But the event 'breakpoint_set ......' would be logged if the program is breaked into debug mode.
Well ... it does work fine here on my Windows 7 x64 SP1; PHP 5.4.15; Xdebug 2.2.2; PhpStorm 6.0.2 build 129.487

Can you please show a screenshot of the IDE when you attemp to set 2nd breakpoint at line #5 (after you already in debug session).
This is how it looks here:
Sure, if I set breakpoint first:
If I start program first:
Let me describe more specific about the step :)



1. No breakpoints be setted brefore run the program
2. Click rerun button to run/debug the program
3. No matter which line be setted a breakpoint, it won't be stopped into debug mode.
Thank you for detailed screenshots -- it clarifies a lot.
AFAIK current behaviour is not a bug and is expected.
I do not know what you are debugging (considering your example) .. but maybe conditional breakpoint will be useful for you here (will only break if some condition is met). Obviously, it has to be set in advance.
Thank you so much for the clearly explanation.
It would really be great if breakpoints can be registered when script runs!
However, thanks again for the kindly help :)