0

I've been using Xdebug and PhpStorm successfully for years. Now I've reinstalled on a new dev machine, it no longer works.

My setup is:

  • Wamp64 server
  • Xdebug 3.1.1

phpinfo() reports:

xdebug
Support Xdebug on Patreon, GitHub, or as a business: https://xdebug.org/support
         Enabled Features (through 'xdebug.mode' setting)             
xdebug.auto_trace => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.cli_color => 0 => 0
xdebug.client_discovery_header => no value => no value
xdebug.client_host => localhost => localhost
xdebug.client_port => 9003 => 9003
xdebug.cloud_id => no value => no value
xdebug.collect_assignments => Off => Off
xdebug.collect_includes => (setting removed in Xdebug 3) => (setting removed in Xdebug 3)
xdebug.collect_params => (setting removed in Xdebug 3) => (setting removed in Xdebug 3)
xdebug.collect_return => Off => Off
xdebug.collect_vars => (setting removed in Xdebug 3) => (setting removed in Xdebug 3)
xdebug.connect_timeout_ms => 200 => 200
xdebug.coverage_enable => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.default_enable => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.discover_client_host => Off => Off
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.file_link_format => no value => no value
xdebug.filename_format => no value => no value
xdebug.force_display_errors => Off => Off
xdebug.force_error_reporting => 0 => 0
xdebug.gc_stats_enable => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.gc_stats_output_dir => (setting renamed in Xdebug 3) => (setting renamed in Xdebug    3)
xdebug.gc_stats_output_name => gcstats.%p => gcstats.%p
xdebug.halt_level => 0 => 0
xdebug.idekey => no value => no value
xdebug.log => no value => no value
xdebug.log_level => 7 => 7
xdebug.max_nesting_level => 256 => 256
xdebug.max_stack_frames => -1 => -1
xdebug.mode => debug => debug
xdebug.output_dir => C:\Windows\Temp => C:\Windows\Temp
xdebug.overload_var_dump => (setting removed in Xdebug 3) => (setting removed in Xdebug    3)
xdebug.profiler_append => Off => Off
xdebug.profiler_enable => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.profiler_enable_trigger => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.show_mem_delta => (setting removed in Xdebug 3) => (setting removed in Xdebug 3)
xdebug.start_upon_error => default => default
xdebug.start_with_request => yes => yes
xdebug.trace_enable_trigger => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.trace_enable_trigger_value => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.trace_format => 0 => 0
xdebug.trace_options => 0 => 0
xdebug.trace_output_dir => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.trace_output_name => trace.%c => trace.%c
xdebug.trigger_value => no value => no value
xdebug.use_compression => 1 => 1
xdebug.var_display_max_children => 128 => 128
xdebug.var_display_max_data => 512 => 512
xdebug.var_display_max_depth => 3 => 3

php.ini looks like this

[xdebug]
zend_extension=xdebug
xdebug.mode=debug
xdebug.client_host=localhost
xdebug.client_port=9003
xdebug.start_with_request=yes
xdebug.idekey=PHPSTORM

PhpStorm configuration is as follows:

PhpStorm server config

PhpStorm debug config

When I click 'debug localhost' in PhpStorm project it opens the browser correctly, with the query string ?XDEBUG_SESSION_START=16111 - but won't stop on any breakpoints.

I also have the Firefox debug extension installed, but I'm not exactly sure how that fits into the whole mix. When I enable to debug extension, cookie XDEBUG_SESSION is dropped with a value of PHPSTORM.

It feels like I'm close, any suggestions here, please? How would I debug Xdebug my setup?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
charliefortune
  • 3,072
  • 5
  • 28
  • 48
  • 1) Where that `phpinfo()` output was captured -- in a CLI or via a web page? I'm asking as it's possible to have separate php.ini used by CLI and web server (mainly Linux & Mac though) so it's better to always get this info from the same environment. 2) Just in case -- try upgrading Xdebug to the latest 3.1.5 (simple download the right file on Xdebug website and restarting WAMP should do). – LazyOne Aug 19 '22 at 08:23
  • 3) *"I also have the Firefox debug extension installed, but I'm not exactly sure how that fits into the whole mix. "* The Xdebug cookie acts as a "debug me" flag. This allows to trigger the debug ON and OFF when needed (e.g. navigate to a certain page in the checkout and enable debug only on the last form submission etc.). The same role as having `?XDEBUG_SESSION_START=xxx` in the query string. But you have `start_with_request=yes` which tells Xdebug to try and debug _every single request_ regardless of that. – LazyOne Aug 19 '22 at 08:26
  • 4) Now your issue -- Enable Xdebug log and try to debug -- it should tell where it tries to connect and what the response is etc. That's the starting point. Also check `xdebug_info();` output (will be similar to `phpinfo` but more focused on Xdebug itself. 5) Also try to debug a super simple script first. Once you have that working you can move to a real script -- it's easier to locate a fault in this case. 6) Another note is to try to debug that simple script in a CLI environment -- the IDE has a bit more control over PHP here... – LazyOne Aug 19 '22 at 08:29

0 Answers0