Search code examples
phpsymfonyphpstormxdebug

phpstorm xdebug with a symfony2 project


I am trying to debug a symfony2 application with xdebug and phpstorm.

My local development environment is Ubuntu 14.04 with apache2 and Xdebug version is 2.2.7

I have this working on another php (not symfony2) projects with the following guides:

https://www.jetbrains.com/phpstorm/help/configuring-xdebug.html

https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm

When I execute the bookmarlet to set the cookie and start debugging this symfony2 project phpstorm detects the incoming connection (which I accept), but nothing else happens. It doesn't stop in any breakpoint.

I have the symfony2 phpstorm plugin. I tried to disable it and get nothing as well.

This answer looked good to me, but it didn't the trick either

Last thing I tried is to change the Servers debug configuration, disabling path mappings. This way phpstorm starts debugging, but it breaks in app_dev.php file instead of any breakpoint I have set.

I am stuck here, any idea would be appreacite

UPDATE

More information I didn't mention:

  • I am using firefox I am trying to debug dev environment
  • Breakpoints are in an action in controller of my own, not vendor ones.

UPDATE

Here is my xdebug configuration

[XDebug]
zend_extension="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_port="9000"
xdebug.profiler_enable=1
xdebug.profiler_output_dir="<AMP home\tmp>"

Solution

  • It was a mapping problem. The following are the steps which did the trick

    1. Disable path mapping under Settings > Languages & Frameworks > PHP > Servers > uncheck "Use path mappings
    2. Start debugging
    3. The famous “Remote file path ‘path/to/script/on/the/server.php’ is not mapped to any file path in project“ finally appears
    4. Then I could follow the Troubleshooting section in official guide setting up path mappings

    Hope this helps to anyone else