Search code examples
phpdebuggingxdebugphpstorm

Exclude other scripts from debugging in PhpStorm


When I start debugging and use another script on the server (e.g. Adminer), i.e. a script outside the project that is not intended to be debugged, the script is paused by PhpStorm and following two warning appear:

  • The script '[path to script]' is outside the project.
  • Click to set up path mappings

Now, I have to press F9 (i.e. resume) to continue script execution. It is very annoying. Can I just exclude these scripts from debugging?


Solution

  • There are few options just for that at Settings | PHP | Debug | Xdebug

    • Force break at first line when no path mapping specified
    • Force break at first line when a script is outside of project

    There is also Settings | PHP | Debug | Skipped Paths, which can be useful in other scenarios when you want to ignore debug requests that were initiated for specific URL, but still debug other URLs. Help page here.