Xdebug on Symfony2, it stops on first line to set up mappings but then it never stops on breakpoints
Hi
it usually takes 5 sec to connect Xdebug to PhpStorm. I have just updated and tried to configure it for my docker powered stack. In another ticket i saw the suggestion to remove the .idea folder and i did after several attempts with the 'Web Server Debug Validation' tool.
Running
PhpStorm 2016.2
Build #PS-162.1121.38, built on July 12, 2016
Licensed to .....
Subscription is active until January 4, 2017
JRE: 1.8.0_76-release-b216 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
My local files are under a project folder mounted on the php-fpm container in docker as project -> /var/www/project.
The symfony folder is under docker so when the xdebug dialog comes asking for path mapping confirmation i map
project/symfony/web -> /var/www/project/symfony/web
This shows in the Event log
20:46 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 never experienced this problem and I didnt benefit from the suggestions on the other tickets. What info can i send to troubleshoot?
Xdebug config on php-fpm is
root@c297b091a3c8:/var/www/myreviews/symfony# php -i | grep xdebug
/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
xdebug
xdebug support => enabled
xdebug.auto_trace => Off => Off
xdebug.cli_color => 0 => 0
xdebug.collect_assignments => Off => Off
xdebug.collect_includes => On => On
xdebug.collect_params => 0 => 0
xdebug.collect_return => Off => Off
xdebug.collect_vars => Off => Off
xdebug.coverage_enable => On => On
xdebug.default_enable => On => On
xdebug.dump.COOKIE => no value => no value
xdebug.dump.ENV => no value => no value
xdebug.dump.FILES => no value => no value
xdebug.dump.GET => no value => no value
xdebug.dump.POST => no value => no value
xdebug.dump.REQUEST => no value => no value
xdebug.dump.SERVER => no value => no value
xdebug.dump.SESSION => no value => no value
xdebug.dump_globals => On => On
xdebug.dump_once => On => On
xdebug.dump_undefined => Off => Off
xdebug.extended_info => On => On
xdebug.file_link_format => no value => no value
xdebug.force_display_errors => Off => Off
xdebug.force_error_reporting => 0 => 0
xdebug.halt_level => 0 => 0
xdebug.idekey => PHPSTORM => PHPSTORM
xdebug.max_nesting_level => 256 => 256
xdebug.max_stack_frames => -1 => -1
xdebug.overload_var_dump => On => On
xdebug.profiler_aggregate => Off => Off
xdebug.profiler_append => Off => Off
xdebug.profiler_enable => Off => Off
xdebug.profiler_enable_trigger => Off => Off
xdebug.profiler_enable_trigger_value => no value => no value
xdebug.profiler_output_dir => /tmp => /tmp
xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
xdebug.remote_addr_header => no value => no value
xdebug.remote_autostart => Off => Off
xdebug.remote_connect_back => Off => Off
xdebug.remote_cookie_expire_time => 3600 => 3600
xdebug.remote_enable => On => On
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => 172.17.0.1 => 172.17.0.1
xdebug.remote_log => no value => no value
xdebug.remote_mode => req => req
xdebug.remote_port => 9000 => 9000
xdebug.scream => Off => Off
xdebug.show_error_trace => Off => Off
xdebug.show_exception_trace => Off => Off
xdebug.show_local_vars => Off => Off
xdebug.show_mem_delta => Off => Off
xdebug.trace_enable_trigger => Off => Off
xdebug.trace_enable_trigger_value => no value => no value
xdebug.trace_format => 0 => 0
xdebug.trace_options => 0 => 0
xdebug.trace_output_dir => /tmp => /tmp
xdebug.trace_output_name => trace.%c => trace.%c
xdebug.var_display_max_children => 128 => 128
xdebug.var_display_max_data => 512 => 512
xdebug.var_display_max_depth => 3 => 3
Notice the 172... ip is ok and infact xdebug connects to phpstorm in the first place. Breakpoints are just not working
Please sign in to leave a comment.
Hi there,
Please collect xdebug log and see what it has to say about it: xdebug.remote_log
So far it looks like wrong path mapping (considering that xdebug connection comes trough).
It may also be the bad line where breakpoint is set -- try setting it on simple one line instructions only. You may also try programmatic breakpoint -- place xdebug_break(); in actual code.
Hi Andriy,
breakpoints are working. Symfony guesses the entry point ie SymfonyCodeRoot/web but the rest of the code is under src, ie
SymfonyCodeRoot/src/Bundle/Controller/MyController.php
setting the root mapping allows it to work. I thought i had tried it but apparently i hadnt.
For anyone readying the post add the mapping on the root path of your symfony project where app, src, web, etc folders are.