Local Community

Debugger breaks on first line even though its deactivated and shows local-bootstrap.php?

I have troubles getting oh-storm to break on the breakpoints. When I load the page it breaks on the first line in a file, not the breakpoint. The session is called local-bootstrap.php and by searching the community I found this thread,

and changed the debug settings in phpstorm, but it makes no difference. Not even after a restart of phpstorm or local.

As you can see in this image, it breaks on the first line in a file, not a breakpoint,

Shared with CloudApp

And my debug settings are these

Shared with CloudApp

It should not break on the first line when it is deactivated.

The magic dust is not working for me???

Oh and I am using localWp version 5.10.3

Shared with CloudApp


What version of PHPStorm do you have? It’s not my main editor, so I’m not as familiar with the nuances of it, but when I was doing some QA with PHPStorm, I had the easiest time with the 2020.2.4 version. Here’s that topic in case some of the troubleshooting things help you in zeroing in on the issue:

I thought I used the latest version for every time I launched PHPStorm it told med that a new version was released and if I wanted to update,

I choose update and the EDI restarted. But reading your answer made me look for the version number.

I used version 2020.3.1 and the update message in the EDI said that version 2020.3.3 was ready to update.

It turned out that even though the EDI restarted and did something it never upgraded. And I went to JetBrains website and downloaded the latest version 2021.1.1, which I installed.

The debugger did break on a line in a session named local-bootstrap.php, Even a line that did not have a breakpoint, but I simply continued the debug until it eventually did break on my breakpoint and from there I was able to debug normally??

So I guess PHPstorm have a few debug issues. Its not perfect now because it still breaks sporadic line when I start a debug session, but I am able to debug now with version 2021.1.1

Nice! I’m glad you were able to get things working.

When the debugger stops within the local-bootstrap.php file, this is due to a recent improvement to Local so that it can make use of WordPress’ “Site Environment Types.”

You should be able to adjust some settings within PHPStorm to prevent that from happening.

See this forum topic for more info:

In the topic linked by @ben.turner, another point is made to move some constant from the local-bootstrap.php to the WP-Config and is implied that would solve the issue of xDebug halting on local-bootstrap.php. Since that topic is closed; this does not solve the issue.

The suggestion to set auto_prepend_file to none (not empty, but the actual value none) will prevent the local-bootstrap.php file to be loaded and that does solve the xDebug issue.

I’d like to go a step further and strongly suggest to remove the local-bootstrap.php completely. It is only used for auto-login, which can also be achieved by placing an MU-Plugin when the feature is used. No need to auto-prepend anything.

1 Like