Try to configure your project in PhpStorm
- Open Settings->Languages & Frameworks->PHP->Debug
- Uncheck the "Ignore external connections through unregistered server configurations" option
- OK
I cannot stress enough the importance of one of the remarks - "Don't forget to set the cookie for xdebug". I had everything right and my debugger still wouldn't attach due to this. One recommendation I can make is to install xdebug helper chrome extension. Once you have it, start the debug from PhpStorm, navigate to the page you want to debug and turn on the debug setting in the extension by clicking the "bug" icon within address bar.
It seems there was one thing I missed when I changed the settings - stopping to listen for breakpoints and then trying again. This seems to have fixed the issue...
The problem was fixed by adding the break points to other parts of the code as it was not working when attached to the try clause. Additionally, here are some other tips that might be useful:
- Try using a programmatic breakpoint: xdebug_break();
- Check that if your php is 32bit then so is the version of Xdebug (or that they are both 64 bit).
- The xdebug remote host setting relates to the server IP address (so 127.0.0.1 for local).
In your Phpstorm goto File > Settings > Languages & Frameworks > PHP > Debug.
Under External conections section, mark the checkbox saying
Ignore external connections through unregistered server configurations
This was fixed for me.

