xDebug symfony controllers

Hi,

I have set up xdebug in phpstorm, and I can debug simple php pages.
However, if I'm  using symfony, when I make a breakpoint in app_dev.php, it will work  perfectly, but it will not work on the breakpoints that I put in the  controller.

Does someone have any idea how to use xdebug with symfony controllers?

Tkx

2 comments

Hi there,

It does not matter if it is a symfony controller or controller from your home-made framework -- it's still just a PHP code.

1) Is your file is inside the project ?
2) Do you have any symbolic links in the path where that file is located? If used -- proper path mappings must be set (Settings | PHP | Servers) since xdebug works with resolved/real paths ONLY.
3) What kind of a line you put your breakpoint in? Xdebug cannot break on some lines due to the way how PHP generates bytecode.
4) Is your breakpoint is registered?

  • a) icon has a "tick" on it
  • b) it is recorded as registered in xdebug log

5) Enable logging from both sides (see below) and see if breakpoint is registered .. and if hit how PhpStorm reacts to it:

6) Is that file (controller) gets executed at all ?
7) Will it work if you trigger breakpoint manually via xdebug_break(); ? Double check what PhpStorm log will say about it (after enabling extra logging, of course)

0

Hi,

Tkx for you fast reply.

I forgot to mention, that im using a "remote" server, its a vagrant VM in my laptop. However, I have configured the "PHP Remote Debug".


Anyway, you helped me solve the problem with your tip 4!!!

the breakpoint in the controller had a cross in it, it was not mapped correctly, but I had already mapped the root folder so...

Well, it seems the server config was not accepted.

I had this:

name: VideoPackager
host: http://videopackager

and it needed this:

name: videopackager
host: videopackager

It actually created a server with these properties and it was using it instead of the one I had created and mapped before. That's why it was complaining about the mappings.

Tkx a lot!

All the best,

Herb

0

Please sign in to leave a comment.