XDebug stops at first line, but ignores some breakpoints in other files

I've never seen xdebug and any IDE behave this way, but never used PHPStorm until this week.

I'm working on a Symfony 2 project with many various deeply-nested include vendor libraries, PHP 5.4, PHPStorm 8, and running the server in remote configuration mode to xdebug on a docker container inside a CentOS VM on Mac OS X Mavericks.

I have gone through various docs and tutorials on setting up the connection between PHP Xdebug and PHPStorm, and if I choose stop at first line, my index.php can be debugged as expected.

At one point I had to path map a particular file, and that worked for that file.

Now I have a new file I'm trying to step into or stop on breakpoint, and it will not work either way. PHPStorm is not prompting me for the file nor bringing up the path mapping option for it. The IDE just sits idle and my browser just spins, eventually getting a 503 from nginx. If I hit the PHPStom xdebug play button and reload the page it comes right back to the first line on index.php.

Is there a way to manually add paths to path mapping like in NetBeans? I cannot for the life of me figure this one out.

Comment actions Permalink

After awhile, I was curious how far it was getting and I realized that if I "step into" every single function, eventually I reach a file that is not path-mapped and I realize I need to path map every single include file in my entire project - once I do that, I can use xdebug on path-mapped files, but before that, xdebug will not work, even for files in the same folder as another file already path mapped. If I press play at some point, hoping to hit the model method I'm calling inside a controller, the breakpoint is never mapped and I can't figure out any way to path map that file without stepping into every included file before it is called.

I must have something very odd going on here because there's no way for me to continue using PHPStorm without xdebug - and I don't have a month to path map the 10,000+ files in this project one by one by one. I've never need to path map every single file in a PHP project before.

Comment actions Permalink

Hi there,

There is something wrong with your setup somewhere.

There is no need to map every single file: mapping a folder will have all files/folders in it to inherit the mapping (unless, of course, there is something that breaks such mapping, like symbolic links etc -- you have to remember that xdebug always works with final/resolved paths ONLY while IDE works with paths as is).

For now I may only suggest to delete settings for this project (.idea subfolder) and re-create and re-configure project from scratch -- maybe something went wrong somewhere.

If this will make no difference -- please provide more info:
* full path to project (problematic file) on local computer
* full path to project (problematic file) on remote computer
* xdebug log for such debug session (showing real paths -- no manipulations please).

Comment actions Permalink

xdebug log for such debug session

Where can I find this?
Comment actions Permalink

I fixed this same issue by updating the remote mappings under Preferences->Languages & Frameworks->PHP->Debug->Servers and since I use vagrant I needed to map my root project folder. Public was already set but not the root.

Left column (File/Directory)

Right column (Absolute path on server)

Comment actions Permalink

I've been using this combination for some time and recently found a similar problem.  For me, Xdebug was working, but then when I started again today, it was only stopping on the first line of each file and not on any breakpoints.  While double-checking the configs, I realized it was looking for a page loaded on port 80, but I had changed my local testing to https and needed to also change the config to 443.  I hope this helps someone else.

Comment actions Permalink

In my case, I had to change the Absolute path on the server. It was pointing to the wrong one. In my case, I use Laravel Valet and it was set to that folder instead of the right one.


Please sign in to leave a comment.