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
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:
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>"
I don't know which browser you are using, but, using Chrome, I use the Xdebug helper extension.
Once the extension is installed, right click on it > options and select PHPStorm as IDE.
Then, start listening for connection on PHPStorm using the button near the debug one.
EDIT :
Here is my configuration of XDebug:
zend_extension=/usr/lib/php5/20121212/xdebug.so
xdebug.max_nesting_level = 1000
xdebug.collect_params = 1
xdebug.collect_return = 1
xdebug.remote_enable = 1
Are you sure XDebug is properly installed on your machine ?
When in PHPStorm
> Run
> Edit Configurations...
, add a PHP Web Application debugging profile and fill it this way:
Press OK and you're done !
I had a similar issue which again proved to be a mapping problem, debugging a Symfony 2 project remotely using PHPStorm.
If PHPStorm can't map the src file locations, it will break on the first line of code in app_dev.php (if you've set 'Break on first line') but then continue straight through any break points set in /src (eg Controllers, Models, etc.) and doesn't flag any error.
Once PHPStorm can map these paths, it stops and breakpoints and meaningful debugging can begin.
It was a mapping problem. The following are the steps which did the trick
Hope this helps to anyone else
If you find that PHPStorm keeps asking for mappings try and create a mapping at the highest level of the project as @stanhope mentioned, that should be enough.
My first mapping was incorrectly set to the app_dev.php file in /web which meant that the IDE kept asking me for mappings to files in vendor directories.
eg /vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Response.php
I also had to comment out the loading of class cache (symfony 2.7). I did it temporarily in the web/app_dev.php
//$kernel->loadClassCache();
Otherwise the debugging took place in bootstrap.php.cache
or breakpoints did not work.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.