Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xDebug dosent work after 4.19.6 on macos PhpStorm #140

Closed
vrs11 opened this issue Mar 17, 2021 · 4 comments
Closed

xDebug dosent work after 4.19.6 on macos PhpStorm #140

vrs11 opened this issue Mar 17, 2021 · 4 comments

Comments

@vrs11
Copy link

vrs11 commented Mar 17, 2021

docker-php-ext-xdebug.ini/z-docker-php-ext-xdebug.ini wont accept any of below:

PHP_XDEBUG: 1
PHP_XDEBUG_MODE: debug
PHP_XDEBUG_REMOTE_HOST: host.docker.internal

Image wodby/drupal-php:7.4-dev-macos-4.24.1 (from this and all the way down to 4.19.6)
Os macos bigsur

@vrs11
Copy link
Author

vrs11 commented Mar 17, 2021

Temp fix:

volumes:
# temp fix for x debug
- ../xdebug_ini/docker-php-ext-xdebug.ini:/usr/local/etc/php/conf.d/z-docker-php-ext-xdebug.ini

and put this to the file:
[xdebug]
zend_extension = xdebug.so
xdebug.mode = debug
xdebug.cli_color = 0
xdebug.client_discovery_header = 0
xdebug.client_host = host.docker.internal
xdebug.client_port = 9003
xdebug.collect_assignments = 0
xdebug.collect_return = 0
xdebug.discover_client_host = false
xdebug.dump_globals = 1
xdebug.dump_once = 1
xdebug.dump_undefined = 0
xdebug.file_link_format = ""
xdebug.force_display_errors = 0
xdebug.force_error_reporting = 0
xdebug.halt_level = 0
xdebug.log = /proc/self/fd/2
xdebug.log_level = 7
xdebug.manual_url = http://www.php.net
xdebug.max_nesting_level = 256
xdebug.max_stack_frames = -1
xdebug.output_dir = /mnt/files/xdebug
xdebug.profiler_aggregate = 0
xdebug.profiler_append = 0
xdebug.profiler_output_name = cachegrind.out.%p
xdebug.scream = 0
xdebug.show_error_trace = 0
xdebug.show_exception_trace = 0
xdebug.show_local_vars = 0
xdebug.start_with_request = default
xdebug.trace_format = 0
xdebug.trace_options = 0
xdebug.trace_output_name = trace.%c
xdebug.trigger_value = ""
xdebug.var_display_max_children = 128
xdebug.var_display_max_data = 512
xdebug.var_display_max_depth = 3

@vrs11 vrs11 changed the title xDebug dosent work after 4.19.6 on macos xDebug dosent work after 4.19.6 on macos PhpStorm Mar 17, 2021
@csandanov
Copy link
Member

What do you mean by "won't accept"? This the template for the xdebug extension: https://github.com/wodby/php/blob/master/7/templates/docker-php-ext-xdebug.ini.tmpl

as you can see below the config file /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini populated successfully:

$ docker run -e PHP_XDEBUG=1 -e PHP_XDEBUG_MODE=debug -e PHP_XDEBUG_REMOTE_HOST="host.docker.internal" --rm wodby/drupal-php:7.4-dev-macos-4.24.1 sh -c 'cat /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini'

[xdebug]
zend_extension = xdebug.so
xdebug.mode = debug
xdebug.cli_color = 0
xdebug.client_discovery_header =
xdebug.client_host = 172.17.0.1
xdebug.client_port = 9003
xdebug.collect_assignments = 0
xdebug.collect_return = 0
xdebug.discover_client_host = false
xdebug.dump_globals = 1
xdebug.dump_once = 1
xdebug.dump_undefined = 0
xdebug.file_link_format = ""
xdebug.force_display_errors = 0
xdebug.force_error_reporting = 0
xdebug.halt_level = 0
xdebug.log = /proc/self/fd/2
xdebug.log_level = 7
xdebug.manual_url = http://www.php.net
xdebug.max_nesting_level = 256
xdebug.max_stack_frames = -1
xdebug.output_dir = /mnt/files/xdebug
xdebug.profiler_aggregate = 0
xdebug.profiler_append = 0
xdebug.profiler_output_name = cachegrind.out.%p
xdebug.scream = 0
xdebug.show_error_trace = 0
xdebug.show_exception_trace = 0
xdebug.show_local_vars = 0
xdebug.start_with_request = default
xdebug.trace_format = 0
xdebug.trace_options = 0
xdebug.trace_output_name = trace.%c
xdebug.trigger_value = ""
xdebug.var_display_max_children = 128
xdebug.var_display_max_data = 512
xdebug.var_display_max_depth = 3

however it's possible that the issue could be in this line:

xdebug.client_discovery_header =

I've released the fix to make sure quotes are always in place

@vrs11
Copy link
Author

vrs11 commented Mar 25, 2021

https://prnt.sc/10v79gx

.env
PHP_TAG=7.3-dev-macos-4.24.1

docker-compose
PHP_XDEBUG_REMOTE_HOST: host.docker.internal

/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
xdebug.client_host = 172.17.0.1 (instead of host.docker.internal)

wodby@php.container:/var/www/html/docroot $ /sbin/ip route|awk '/default/ { print $3 }'
172.19.0.1

so configs from env don't go to docker-php-ext-xdebug.ini

@vrs11
Copy link
Author

vrs11 commented Mar 25, 2021

Wrong env name

PHP_XDEBUG_CLIENT_HOST is correct one

@vrs11 vrs11 closed this as completed Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants