Just tried remote debugging a project on a Joomla Box in PhpStorm and it's pretty erratic.
I'm debugging a save() method in a controller. Some breakpoints are missed entirely when they should be hit, and the ones that are being hit will often step through incorrectly. As an example:
$app->setUserState('foo', 'foo');
$validData['modified'] = JFactory::getDate()->toSql();
A breakpoint at the setUserState method will immediately step through to getDate(), not setUserState(). Add another setUserState above it and the breakpoint is missed entirely.
Other breakpoints seem to be offset by a line - for example a breakpoint at the return statement will be skipped, but a breakpoint at the closing curly braces won't be.
Meanwhile everything's working fine on my XAMPP and Debian installs.
Joomla Box install is mostly clean - I disabled Z-Ray due to the conflict with phpMyAdmin.
I also disabled Varnish thinking the problems may be due to caching. At least I think I disabled it - despite getting "Varnish is already disabled!" in the terminal I'm still getting an "Error 503 Backend fetch failed" message from the Varnish cache server if I leave the debugger paused for a while. So I'm thinking my problems may still be related to caching somehow and I might not have turned Varnish off properly.
Any advice would be appreciated.