I’m having problems setting up debugging on Wordpress using Local and PhpStorm.
On previous versions of Local I’ve been able to get debugging working by setting up a server similar to this
I then hook this up to a PHP Web Page configuration and when I start a debugging session using the web page my break points are hit.
Since I’ve started using version 5.9.4 this no longer works.
I have had some limited success when I untick the “Use path mappings” checkbox when setting up the server and then sometimes my breakpoints are hit, but other times the break points are ignored.
I think this is linked to the ide key, I’ve been using phpinfo() to log the xdebug variables and when the break points are being hit the ide key corresponds to the number that is generated when I start the debugging session
But when the breakpoints are not being hit the ide key value is “Ian” (which is the user account name I’m using on Windows), I’m struggling to see why the value of the ide key would change in this way and I’m struggling to see why it changes as it seems to happen at random intervals.
I’m using Local on a Windows 10 Professional machine.
I’m unsure if the set-up I’m using is the correct one as I’m struggling to find definitive guidance on how to set-up a debugging for Wordpress using Local and PhpStorm on a Windows box. Specifically I’m wondering
Should I use path mappings to debug Wordpress using Local and PhpStorm or will it work with local files
Is the PHP web page configuration the right one to use or should I use something else like “PHP Remote Debug”
I have tried the plugin but I get a script error message when I try to generate the config files.
I’d ideally like it if some one could provide or point me to an example of the set-up they are using to debug Wordpress using Local and PhpStorm on a Windows box, but any help would be massively appreciated as I’ve been struggling with this for some time. Thanks
Adding a comment here because I’m having this issue too.
Each time I experiment and try reconfiguring, it works the first time I refresh a page and a breakpoint is hit, so the problem seems to be solved, then the next time I refresh the page to use the debugger again, the breakpoints are entirely ignored. It’s an emotional rollercoaster.
Edit: Confirming that this issue seems to be related to what ipr161 is saying. Each time I stop the site and restart the site in Local, the debugger starts working again for a few turns. Then, a short and seemingly random amount of time later, it stops working entirely - no errors, nothing indicating that it’s not working other than that the page just loads and the debugger doesn’t stop at any breakpoints.
Edit 2: I rolled back to Local version 5.8.2 and debugging is working for me again, so it looks like there was a breaking change somewhere between 5.8.2 and 5.9.4. I’m going to keep working on 5.8.2 since not having a reliable debugger is somewhat of a dealbreaker for development.
I am having similar symptoms and in my case it’s a problem with the recent update to PHPStorm (2020.3). If you are using PHPStorm and have updated to 2020.3 you could try rolling back to PHPStorm 2020.2 - this worked for me.
According to JetBrains the issue is related to a bug in XDebug and changes they made in 2020.3, but I can’t test that unless there’s a way to upgrade XDebug in local (see my recent post. It should also, hopefully, be fixed in the next update to PHPStorm.
Yes, I want to confirm that after I was developing a little further with Local 5.8.2, the problem started showing up again though not as often so it took me longer to spot. I then rolled back to PhpStorm 2020.2 and the problem stopped entirely, so it looks like it’s not Local’s fault after all.
Everything is also working for me now after switching to version 2020.2, thanks to spencercloud and rowatt for taking the time to reply to my original post.
Hey guys. With the PHPStorm update to 2020.3.1, it looks like they fixed the debugger issues. I updated yesterday and haven’t had any problems with Xdebug as of yet.