In PHP development environments, it is not entirely uncommon to use an auto_prepend_file
to add development-specific functionality to an application.
Usually such a file is used for several projects at the same time. This means the prepend file resides somewhere in a more high-level location.
A more common practice is to use Xdebug te debug PHP code.
When combining these two with PhpStorm this will lead to the prepend file being marked as "not mapped".
Every time a debug session is started, it will stop at the first step. This is because the prepended file is not part of the project. PhpStorm will stop the debugger in order to ask the user to add a mapping to the prepend file.
It is possible to manually skip/continue (or step through) the prepend file but this gets boring real fast.
It would be nice if the file could just be skipped, but how do we do that?
Although PhpStorm has the ability to skip paths, this only sadly only works for file within the project.
But there is another solution that will work for files living outside of the project.
In the settings, under Languages & Frameworks > PHP > Debug
, unset the following settings:
- Break at first line in PHP Scripts
- Force break at first line when no path mapping specified
- Force break at first line when a script is outside the project
Now, whenever a debug session is started, it will skip straight to the first breakpoint.
Happy times!