10 Replies Last post: Sep 17, 2013 9:48 PM by Stuart Barker  
Stuart Barker Newbie 14 posts since
Aug 23, 2012
Currently Being Moderated

Sep 3, 2013 8:05 PM

Xdebug only works if breakpoint is on first line of script

Has anyone else noticed this?  I'd like to be able to stop anywhere in script rather than just first line.  I'm using the zero config method.

Andriy Bazanov Master 4,179 posts since
May 28, 2010
Currently Being Moderated
Sep 3, 2013 8:14 PM in response to: Stuart Barker
Re: Xdebug only works if breakpoint is on first line of script

Hi there,

 

It has to be your machine/code specific -- it works fine here on Windows 7 x64; xdebug 2.2.3 and PHP 5.4.19. What's your xdebug version?

 

Please note that xdebug is unable to break if breakpoint is set on certain lines (due to the way how PHP generates the byte code), e.g. multi--line variable/array definition; if statement with no braces etc. What kind of code you have there (breakpoints)?

 

In any case: "Run | Break at first line in PHP scripts" -- try turning it on/off few times. Sometimes it stuck (for unknown reason) and wrong status is displayed -- maybe (just maybe) it may affect your situation as well.

Andriy Bazanov Master 4,179 posts since
May 28, 2010
Currently Being Moderated
Sep 3, 2013 9:28 PM in response to: Stuart Barker
Re: Xdebug only works if breakpoint is on first line of script

Well .. if it works in another project .. and it woks if first line is commented .. then it's possible that problem is in actual files. See if you can change anything about them (e.g. re-type first 2 line manually ... or maybe copy and paste back and then save -- things like that).

 

On another hand -- I recommend upgrading your xdebug. v2.2.0 is quite unstable (has some issues) -- minimal recommended version is 2.2.1 (latest stable is 2.2.3).

 

P.S.

Can you please show what kind of lines they are (I'm curious about that -- why it behaves that way) -- screenshot is enough.

Andriy Bazanov Master 4,179 posts since
May 28, 2010
Currently Being Moderated
Sep 3, 2013 9:31 PM in response to: Stuart Barker
Re: Xdebug only works if breakpoint is on first line of script

You can also try re-configuring this particular project from scratch (in case it's some kind of project settings issue):

 

  • Close project in IDE
  • Backup and delete (or just rename) .idea subfolder in your project root (that's where project settings are stored)
  • You can open that project again via "File | Open Directory"
Andriy Bazanov Master 4,179 posts since
May 28, 2010
Currently Being Moderated
Sep 5, 2013 9:20 PM in response to: Stuart Barker
Re: Xdebug only works if breakpoint is on first line of script

Unfortunately I'm not a Mac user and have no way of testing/reproducing anything like that here.

 

Your description (the difference between projects: A) and B) ) does not give me any clues on what may be wrong and where (I'm using Windows 7 and IIS 7.5 here; but even back then when I've used Apache, it always worked for me (yeah, Windows for the win )).

 

Maybe somebody from dev/support team will be able to help you here. If you will not see any response from them within 2-3 days just create new ticket on Issue Tracker with as many details as possible.

 

The only other thing I may suggest right now is to try and collect debugger logs (but I do not really expect this to be very useful). 1) Logs need to be collected from both PhpStorm side as well as xdebug; 2) attemp to debug your code:

Andriy Bazanov Master 4,179 posts since
May 28, 2010
Currently Being Moderated
Sep 5, 2013 9:42 PM in response to: Stuart Barker
Re: Xdebug only works if breakpoint is on first line of script

Well .. see if "File | Rename Project" will help here (I'm thinking  -- maybe you gave some projects custom name .. and some where left as is).

 

BTW -- have you tried with re-configuring project from scratch (deleting .idea folder as I have suggested) ?

More Like This

  • Retrieving data ...