I am working on setting up Xdebug on Docker using this course- https://github.com/markshust/docker-magento
The site is up and running fine but Xdebug will not work. On the Chrome browser I have this setup-
Here are what my settings on PHPStorm look like-
Here is what the Run/Debug configuration looks like-
Here is all of my php information-
This is to show I did not forget the breakpoint-
What am I missing?
Edit: In Text Form-
xdebug
Version => 3.1.2
Support Xdebug on Patreon, GitHub, or as a business:
https://xdebug.org/support
Enabled Features (through 'xdebug.mode' setting)
Feature => Enabled/Disabled
Development Helpers => ✘ disabled
Coverage => ✘ disabled
GC Stats => ✘ disabled
Profiler => ✘ disabled
Step Debugger => ✘ disabled
Tracing => ✘ disabled
Optional Features
Compressed File Support => yes (gzip)
Clock Source => clock_gettime
Directive => Local Value => Master Value
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 => host.docker.internal =>
host.docker.internal
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 => PHPSTORM => PHPSTORM
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 => no value => no value
xdebug.output_dir => /tmp => /tmp
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.profiler_enable_trigger_value => (setting renamed in
Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.profiler_output_dir => (setting renamed in Xdebug 3) =>
(setting renamed in Xdebug 3)
xdebug.profiler_output_name => cachegrind.out.%p =>
cachegrind.out.%p
xdebug.remote_autostart => (setting renamed in Xdebug 3) =>
(setting renamed in Xdebug 3)
xdebug.remote_connect_back => (setting renamed in Xdebug 3) =>
(setting renamed in Xdebug 3)
xdebug.remote_enable => (setting renamed in Xdebug 3) =>
(setting renamed in Xdebug 3)
xdebug.remote_host => (setting renamed in Xdebug 3) => (setting
renamed in Xdebug 3)
xdebug.remote_log => (setting renamed in Xdebug 3) => (setting
renamed in Xdebug 3)
xdebug.remote_log_level => (setting renamed in Xdebug 3) =>
(setting renamed in Xdebug 3)
xdebug.remote_mode => (setting renamed in Xdebug 3) => (setting
renamed in Xdebug 3)
xdebug.remote_port => (setting renamed in Xdebug 3) => (setting
renamed in Xdebug 3)
xdebug.remote_timeout => (setting renamed in Xdebug 3) =>
(setting renamed in Xdebug 3)
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 => (setting removed in Xdebug 3) =>
(setting removed in Xdebug 3)
xdebug.start_upon_error => default => default
xdebug.start_with_request => default => default
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
2
Answers
While I can’t exactly say what is the problem, I suggest making these changes:
Filter debug connection by IDE key
configuration. The IDE key is somewhat useful if you have multiple websites that need to go to different environments, but I’m guessing that’s not an issue for you.Break at first line in PHP scripts
.There might be a couple of additional ideas in the troubleshooting section here.
Since you are on Linux/Ubuntu, it’s possible the
host.docker.internal
host entry isn’t set up on your local machine, which means Xdebug wouldn’t be able to see Docker as a server to connect to.This should be able to be resolved by adding an entry to your local machine’s
/etc/hosts
file containing the value of your Docker network IP.You can retrieve the Docker network IP by running:
Then, assuming that value is
172.17.0.1
, you can add the entry to/etc/hosts
like so:This binds the
host.docker.internal
hostname to your Docker daemon, so now Xdebug would be able to connect to it.