gwomacks / php-debug

Atom Text Editor package for PHP debugging
MIT License
119 stars 31 forks source link

Debug session don't start on a breakpoint after upgrading to 0.2.5 #239

Closed BusfyJan closed 6 years ago

BusfyJan commented 7 years ago

My only non-default option is Path Maps and it is working on 0.2.4

SebaEnaMor commented 7 years ago

I have the same issue. Before last update it was working briliantly.

eridiumdev commented 7 years ago

same

cchamplin commented 7 years ago

Can you guys provide copies of your config for php-debug?

BusfyJan commented 7 years ago
"php-debug":
    PathMaps: [
      "/web/workspacesza/busfy;/Users/busfy/Documents/work/workspaces/local/busfy"
    ]
    currentPanelHeight: "394px"
    currentPanelMode: "bottom"
kenorb commented 7 years ago

236 could be related, but I had this issue since v2.5.4.

cchamplin commented 7 years ago

@BusfyJan is there anything in the atom development console as far as additional messages?

BusfyJan commented 7 years ago

I added a breakpoint and tried to start xdebug session and my console looked like this:


/Users/busfy/.atom/packages/weather/lib/weather-data.coffee:29 Fetching weather
/Users/busfy/.atom/packages/weather/lib/weather-data.coffee:146 Fetching weather using currentWeatherUrl
/Users/busfy/.atom/packages/sync-settings/lib/sync-settings.coffee:93 checking latest backup...
/Users/busfy/.atom/packages/sync-settings/lib/sync-settings.coffee:392 Creating GitHubApi client with token = MY TOKEN
/Users/busfy/.atom/packages/weather/lib/weather-data.coffee:146 Fetching weather using forecastWeatherUrl
/Users/busfy/.atom/packages/sync-settings/lib/sync-settings.coffee:118 latest backup version MY_TOKEN
/Users/busfy/.atom/packages/php-debug/lib/engines/dbgp/dbgp.coffee:50 Listening on Address:Port 127.0.0.1:9000
/Users/busfy/.atom/packages/weather/lib/weather-data.coffee:29 Fetching weather
/Users/busfy/.atom/packages/weather/lib/weather-data.coffee:146 Fetching weather using currentWeatherUrl
/Users/busfy/.atom/packages/weather/lib/weather-data.coffee:146 Fetching weather using forecastWeatherUrl```

there is a log regarding php-debug: **/Users/busfy/.atom/packages/php-debug/lib/engines/dbgp/dbgp.coffee:50 Listening on Address:Port 127.0.0.1:9000**
guix77 commented 7 years ago

Confirming here... Not much logs to show you :(

BusfyJan commented 7 years ago

Maybe this will help you:

Output of: $ php -i | grep xdebug

/usr/local/etc/php/7.0/conf.d/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 => no value => no value
xdebug.max_nesting_level => 256 => 256
xdebug.max_stack_frames => -1 => -1
xdebug.overload_var_dump => 2 => 2
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 => /var/tmp/ => /var/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 => Off => Off
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => localhost => localhost
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 => /var/tmp/ => /var/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
rainmaker666 commented 7 years ago

I have the same problem. When I tried to start xdebug I got this error in xdebug log file:

Log opened at 2017-08-14 09:47:10 I: Checking remote connect back address. I: Checking header 'HTTP_X_FORWARDED_FOR'. I: Checking header 'REMOTE_ADDR'. I: Remote address found, connecting to 192.168.33.1:9000. E: Time-out connecting to client. :-( Log closed at 2017-08-14 09:47:10

I am using it inside vagrant. Before upgrade it was working with same configuration.

ghost commented 7 years ago

I suggest downgrading to version 0.2.4 of php debug

Here is what I did:

1) First you need to uninstall the package if you have it installed in atom.io and close the program

2) This applies to windows users, else skip to 3. You need to install apm. This is actually already installed, so you just need to connect it to the command promt. Here is what we do: Depending on were you installed your atom, the apm bin would be somewhere like this "C:\Users\xxxx\AppData\Local\atom\app-1.19.1\resources\app\apm\bin\" (if you are having issues finding it, I suggest typing %appdata% in windows pathfinder. So now you type "view advanced system settings" in the windows search field, click 'Enviroment Variables', select 'Path', click edit. Now add the path we found earlier "C:\Users\xxxx\AppData\Local\atom\app-1.19.1\resources\app\apm\bin\" (last backslash is important)

3) Open a command promt, or console if you use linux. Type "apm install php-debug@0.2.4 Once the window writes "Done" close it.

Now you are able to use atom with php debug version 0.2.4

SebaEnaMor commented 7 years ago

I have downgraded to 0.2.4 as @ZeskaN posted above so PHP-Debug is now working correctly. But atom is showing that there is one package update to install right now :(

BusfyJan commented 6 years ago

Any updates on this issue?

cxelegance commented 6 years ago

I was unable able to get the 0.2.4 downgrade to work. Watching the Atom debugger, I saw that the initial xdebug connection was made but then subsequent code runs were being rejected immediately by the plugin. I am without xdebug until I have time to debug further.

mkosir commented 6 years ago

Same here, with new version 0.2.5 debuuging doesn't work anymore. Rollback to 0.2.4.

cchamplin commented 6 years ago

Alright so I believe this is likely caused by the changes to the server binding for the plugin in 0.2.5. I've fixed several issues around this in 0.2.6.

You may still experience problems because xdebug is attempting to connect to a different address then the new default (127.0.0.1). You can have PHP-Debug bind to all addresses (0.0.0.0) [The behavior in 0.2.4 and below] by setting the *ServerAddress option to ""**

Please let me know if this resolves the issue for you

ghost commented 6 years ago

Okay, I've updated this plugin, then in plugin settings changed option: ServerAddress from defaults 127.0.0.1 to * and it starts debuging correctly. It doesn't matter if xdebug.remote_host setting in php.ini is equal to localhost or 127.0.0.1 as well.

Sut3kh commented 6 years ago

Yep confirmed, it was because the new version was only listening to 127.0.0.1 whereas before it was 0.0.0.0 (due to the new config option having a different default value to the old behaviour).

I'm guessing it is a bit late to have an upgrade path to set it to 0.0.0.0 instead of letting it fallback to the default for existing installs but never mind, at least i don't have a permanent update notification in my atom anymore!

cxelegance commented 6 years ago

I still can't get breakpoints to work. I think once they worked for me in 0.2.5 but I can't remember what config I had. It seems that PHP-Debug thinks there's a connection active while XDebug believes the connection was closed (immediately).

I have the following setup, where XDebug is installed on a server on the VPN, and my Atom has PHP-Debug 0.2.6.

Server config:

zend_extension=xdebug.so xdebug.var_display_max_data=50000 xdebug.collect_params=3 xdebug.remote_log=/tmp/jesse.xdebug.log xdebug.remote_enable=on xdebug.remote_connect_back=1 xdebug.remote_autostart=0 xdebug.remote_mode=req xdebug.remote_handler=dbgp xdebug.remote_port=9000

Atom config:

"php-debug": DebugXDebugMessages: true PathMaps: [ "/var/www/;/Volumes/Files/Documents/03 computers and technical/01 web projects/20170430 project/04 rsync working dir/" ] ServerAddress: "*" currentConsoleHeight: "202px" currentPanelMode: "bottom"

Action: Start PHP-Debug Observations:

Action: enable XDebug Helper in Chrome

Action: load PHP page via Chrome Observations:

Log opened at 2017-12-13 21:20:37 I: Checking remote connect back address. I: Remote address found, connecting to 10.100.100.225:9000. E: Time-out connecting to client. :-( Log closed at 2017-12-13 21:20:37

Action: set some Atom/PHP-Debug breakpoints in PHP file

Action: re-load PHP page Observations:

Log opened at 2017-12-13 21:25:15 I: Checking remote connect back address. I: Remote address found, connecting to 10.100.100.225:9000. E: Time-out connecting to client. :-( Log closed at 2017-12-13 21:25:15

conversica-paulw commented 6 years ago

Configuring server address to * has fixed it for me in 0.2.6 (on Ubuntu 16.04.) Thank you.