1

I'm using Xdebug and PhpStorm to debug a PHP application.

It's all working perfectly in terms of actually doing the debugging, however, intermittently PhpStorm will remove all the breakpoints I've set up.

There seems to be no pattern or action which is causing this, so far it seems totally random (although I know it's probably not).

Here's what happens:

  • I add 10 or 15 breakpoints to various files.
  • I setup a load of test data to figure out a problem.
  • I start debugging and realise it hasn't stopped at any of my breakpoints, so I check the list of breakpoints in PhpStorm and they've all disappeared.. so I have to go back to step 1 and redo all my test data and remember where breakpoints were set.

IntelliJ / PhpStorm support say they've never heard of this happening before, and are just telling me to essentially "factory reset and try again" to see if it helps.

I'd prefer to keep that as a last resort because it'll take me ages to get everything back how I want it so I'm hoping some other people have experienced this and I'm not just going insane?

I'm on the latest version 2021.3 (Build #PS-213.5744.279, built on December 2, 2021)

I've been doing a lot of debugging today and it's happened 7 or 8 times. Sometimes it won't happen all day.

10
  • 1
    "...and are just telling me to essentially "factory reset and try again" to see if it helps." You should do it just to see if that helps (as this may give some hints). You can restore prev settings from a backup (that option should do it before the reset or you can make a backup of config file manually). Commented Jan 5, 2022 at 17:15
  • I'll try it when I can get some free time, but once I've reset it'll probably take me at least an hour to setup the project and xdebug again I imagine. Will have to wait until the weekend to give it a go. Because it's intermittent I'd then have to do development for x hours with unusual settings until it randomly happens. Commented Jan 5, 2022 at 17:17
  • Anyway: I also never heard of loosing breakpoints in such a manner before. Maybe it's related to the VCS (in case if you track .idea there) .. or perhaps can be linked to changing Run/Debug Configurations (I know watches are linked to that, not sure about breakpoints). BTW -- when/at what moment do you loose them? Like: it's working, you do debugging .. and then on next run they are all just gone? Commented Jan 5, 2022 at 17:18
  • I did consider git initially, but I hadn't changed branch when it happened or done any git actions so it's looking unlikely. It varies. Several times today it's been as you've described, debugging fine, go to do another run of the same scenario and it's removed all my breakpoints between run 1 and 2. But one today I was doing a global search (Ctrl + Shift + F), and when I pressed ESC to close the search modal, I actually saw all the red dots (breakpoints) disappear. I tried the same action again and couldn't reproduce that though. Commented Jan 5, 2022 at 17:21
  • If it happens randomly: try to remember when it happens; then check the idea.log (Help | Show Log in XXX) for a possible hints (some exceptions/error messages etc)... BTW: PHP breakpoints are normally saved in .idea/workspace.xml file -- look for <component name="XDebuggerManager"> node). Maybe that file gets modified externally somehow (just a thought)... Note that config files may not be updated immediately, the Save may happen on closing the project only. Commented Jan 5, 2022 at 17:24

1 Answer 1

2

So, apologies, I didn't even think to mention that I'm also using DataGrip (another IntelliJ IDE for DB tools), it turned out because I was using these on the same directory, they were conflicting with each other and overwriting the file it stores breakpoints in (thanks @LazyOne for that info!).

There's apparently no way of having them use the same project independently, so I've had to use a slightly different folder in the project for DataGrip. Probably cleaner solutions available but this will do for now!

Thanks everyone.

Sign up to request clarification or add additional context in comments.

3 Comments

1) You can use the same folder (actual code files).. but it will be separate configs (project settings). A little bit of manual tweaking to have it this way, nothing big. Please describe how you are using them. 2) Please also describe why you need DataGrip. Currently PhpStorm has the same functionality as DataGrip in DB management/access regard.
i use the same setup as OP. For me, it's focusing on PHP and debugging in Storm, while having quick access to several data connections i manage, but also work on SQL files in the PHP project. Sure, some redundancy, but focused tasking. If i get the chance to make config changes that successfully separate them, i'll come back and post an answer.
gist.github.com/vipulmathur/7d4f3dde35674874892ca61442fdf8f5 - This actually turned out to be pretty helpful. It's a workaround - several issues have been made for an "official" solution. But this explains how to set each IDE project up in its own folder, and symlink (or junction in Windows) to the project code from each IDE folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.