Annoying warnings "Debug session was finished without being paused" in PhpStorm with Vagrant and Xdebug
Asked Answered
B

3

16

I have properly running xdebug on vagrant on my local pc on Ubuntu. It shows its orange table with error info. My testing page is localhost:8030

In Chrome browser I have Xdebug helper.

The problem is that an annoying warning is displaying in PhpStorm each time I refresh the site:

Debug session was finished without being paused
It may be caused by path mappings misconfiguration or not synchronized local and remote projects.
To figure out the problem check path mappings configuration for 'localhost' server at PHP | Servers or enable Break at first line in PHP scripts option (from Run menu).

I have checked path mappings configuration for 'localhost' server at "PHP | Servers" and they are OK. My PhpStorm project directory is associated to default Vagrant directory /vagrant/web/.

Enabling Break at first line in PHP scripts option does help but it is kind of an opportunism I think.

How to get rid of these PhpStorm warnings?

Brandwein answered 4/5, 2018 at 2:3 Comment(6)
this may sound off the wall, but whenever i get a weirdo like that with any jetbrains IDE, i invalidate caches and restart. Seems the best bug fixer amongst all their programmers.Haha
@Haha invalidate caches did not help.Brandwein
So .. where does it break then? What file? What xdebug log has to say about that particular session? You need to provide details in order to be able to "fix" it. NOTE: you will also see this if you do not have any breakpoints setup but trying to debug. Or .. when you have breakpoints .. but they are on wrong lines or unreachable places. Details please.Wiskind
I get this all the time when I have multiple web apps running or doing ajax requests in the background.Uretic
@Wiskind After some workaround I got to conclusion that it is not unnormal that the warning is shown when there is no breakpoins in the file. When I put some the warning went out.Brandwein
@Brandwein You might need to add one more mapping to your public folder. This is where your index.php file lies. So usually there are two mappings. One for your project root directory and one for your public folder.Isoagglutination
C
24

For PhpStorm 2021.1.1 +

[Ctrl] + [Alt] + S Settings : Php -> Debug

Scroll to Advanced settings and expand

Uncheck option Notify if debug session was finished without being paused

Crashaw answered 21/6, 2022 at 8:44 Comment(2)
Thank you so so so much. I have fetch requests running in the bbackground. I don't care if these finish without being interrupted. These warnings were so annoying.Solander
you sir... deserve a beer for thisMenstrual
B
12

It would do this if there are no breakpoints being hit when debugging the script. The "break at first line" probably prevents PhpStorm from issuing you the warning, but otherwise it does exactly the same.

In case you do have breakpoints configured, and PhpStorm doesn't stop on them, then it is likely that you have path mappings configured wrongly.

Using Xdebug's xdebug.remote_log=/tmp/xdebug.log setting/feature to see which breakpoints PhpStorm tries to set, and see whether it does so for the correct paths. They will up as breakpoint_set commands in the log file.

Bracci answered 22/5, 2018 at 13:45 Comment(1)
Exactly what have happened with me. I placed a breakpoint inside a wp-cron job, which explains why it have not entered. Moment I placed a breakpoint on a linear function, it broke and have not displayed this message.Gales
A
1

in my case it was path mapping problem. but my question always was, i am using wamp server, so everything is served locally for myself to debug, what does path mapping mean in this case cause there is no remote server... should i map File/Directory to itself? if so what is the point...

Altough my question is not answered, but it turned out that i had to do exactly that.

Solution: I had to copy paste exact value from File/directory to Absolute path on the server tab.(acording to imagephpstorm setting/PHP/servers/add one) I did it for main parent directory of my project

I also mapped my laravel/public folder to my wamp64/www/project-name folder because of the fact that public assets or index.php file should be accessible by anyone but laravel source code (main files eg controllers models and...) should not be in the public folder

thats it.

Arlyn answered 1/4 at 5:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.