Help debugging Local by Flywheel with PHPStorm

I am currently using PHPStorm 2023.2.1 and Local by Flywheel 7.1.2+6410 and am unable to get debugging with XDebug working.  As a long time ReSharper user I prefer PHPStorm for editing but at the moment I have to switch to VS Code to debug.  This means I know for sure that Local by Flywheel is configured correctly for debugging as I hit breakpoints in VS Code without problem.

I have googled and followed several guides on how to set this up and it seems it should be simple, but just doesn't work for me.  Probably some dumb developer issue on my part although I have over 30 years experience developing in many different languages with different tools including JetBrains tools.

These are some of the guides I have followed, but pretty much everything I find is quite old:

https://www.bjornjohansen.com/profiling-xdebug-local-by-flywheel-phpstorm
https://www.hardworkingnerd.com/how-to-debug-with-phpstorm-and-local-by-flywheel/
https://coder-joey.github.io/Local-Dev-PHPStorm-Local-by-FlyWheel/

As you can see I have the Local by Flywheel Add-On installed and enabled for integration with PHP Storm


 

And I have used the option to create the run configuration from the local site Tools tab.



 

This is the configuration created by the Plugin and it seems correct to me

But if I hit the run button in that dialog or click the Debug with Local button PHPStorm my breakpoints are not hit.

I have tried this with the Start Listening for PHP Debug Connections on and off, but no joy breakpoints are not hit.

I have tried this with a fresh restart of my computer and only Local by Flywhee and PHPStorm running so it is not VS Code getting in the way.

Any help greatly appreciated so I can just work with PHPStorm for this project.

0
4 comments

This is the configuration created by the Plugin and it seems correct to me

Please avoid using Run/Debug configurations for debugging web applications - the zero-configuration approach is much more convenient.

As for the issue itself, please configure Xdebug remote log (it's better to create the file and set 777 permissions on it manually) and then check if it gets populated when you try to debug.

If it is, please share the log file. If it isn't, please share the phpinfo() output generated by your web server as an HTML file. You can upload both files here: https://uploads.services.jetbrains.com/

0

Thanks for the quick response.  I will try the Zero Configuraiton approach and let you know how it goes.

0

Following the zero-configuration approach did not work at first.  My breakpoints were not hit.  I tinkered with some settings under PHP\Debug and found it worked if I disabled the Ignore external connections through unregistered server configurations and got into debug mode.

However every time I make a request even if there are no breakpoints it breaks at line 42 in local-bootstrap.php, which has this.

$GLOBALS['wp_filter'] = array(
  'init' => array(
   10 => array(
    'localwp_auto_login' => array(
     'function'      => 'localwp_auto_login',
     'accepted_args' => 1,
    ),
   ),
  ),
);

I then disabled Force break at first line when no path mapping specified but still had the problem.  Disabling Force break at first line when no path mapping specified resolved that issue.

So I can no debug my pages in my Local by Freewheel site but I do get a lot of warning notifications with the message Debug session finished without being paused.  I will look into the guidance with the message to see if I can resolve them.

0

At Settings | PHP | Debug | Settings, you can disable Notify if debug session was finished without being paused, but please keep this change in mind in case you have issues with debugging in the future - the message can be quite useful when it comes to troubleshooting what is going on with debugging.

0

Please sign in to leave a comment.