Cannot enable Xdebug (php 7.4)

Hello.

I'm trying to setup Xdebug on a new Docker website under Win10/Drupal 8, php 7.4. Until now, my other stacks are working with xdebug, but I didn't succeed to repeat the setup under my new website. Phpinfo shows Xdebug 3 installed, but phpstorm doesn't hang on breakpoints.

Could you help me please ?

5 comments
Comment actions Permalink

Could you please share your dockerized web server's phpinfo() output?

0
Comment actions Permalink

This is the php part, on top :

PHP Version 7.4.21

System Linux e49f9d797da4 5.10.25-linuxkit #1 SMP Tue Mar 23 09:27:39 UTC 2021 x86_64
Build Date Jul 1 2021 20:09:06
Configure Command './configure' '--build=x86_64-linux-musl' '--with-config-file-path=/usr/local/etc/php' '--with-config-file-scan-dir=/usr/local/etc/php/conf.d' '--enable-option-checking=fatal' '--with-mhash' '--with-pic' '--enable-ftp' '--enable-mbstring' '--enable-mysqlnd' '--with-password-argon2' '--with-sodium=shared' '--with-pdo-sqlite=/usr' '--with-sqlite3=/usr' '--with-curl' '--with-libedit' '--with-openssl' '--with-zlib' '--with-pear' '--enable-fpm' '--with-fpm-user=www-data' '--with-fpm-group=www-data' '--disable-cgi' 'build_alias=x86_64-linux-musl'
Server API FPM/FastCGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/etc/php
Loaded Configuration File /usr/local/etc/php/php.ini
Scan this dir for additional .ini files /usr/local/etc/php/conf.d
Additional .ini files parsed /usr/local/etc/php/conf.d/docker-php-ext-amqp.ini, /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini, /usr/local/etc/php/conf.d/docker-php-ext-ast.ini, /usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini, /usr/local/etc/php/conf.d/docker-php-ext-blackfire.ini, /usr/local/etc/php/conf.d/docker-php-ext-bz2.ini, /usr/local/etc/php/conf.d/docker-php-ext-calendar.ini, /usr/local/etc/php/conf.d/docker-php-ext-ds.ini, /usr/local/etc/php/conf.d/docker-php-ext-exif.ini, /usr/local/etc/php/conf.d/docker-php-ext-gd.ini, /usr/local/etc/php/conf.d/docker-php-ext-gmp.ini, /usr/local/etc/php/conf.d/docker-php-ext-grpc.ini, /usr/local/etc/php/conf.d/docker-php-ext-igbinary.ini, /usr/local/etc/php/conf.d/docker-php-ext-imagick.ini, /usr/local/etc/php/conf.d/docker-php-ext-imap.ini, /usr/local/etc/php/conf.d/docker-php-ext-intl.ini, /usr/local/etc/php/conf.d/docker-php-ext-ldap.ini, /usr/local/etc/php/conf.d/docker-php-ext-mcrypt.ini, /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini, /usr/local/etc/php/conf.d/docker-php-ext-mongodb.ini, /usr/local/etc/php/conf.d/docker-php-ext-mysqli.ini, /usr/local/etc/php/conf.d/docker-php-ext-newrelic.ini, /usr/local/etc/php/conf.d/docker-php-ext-oauth.ini, /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini, /usr/local/etc/php/conf.d/docker-php-ext-pcntl.ini, /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini, /usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini, /usr/local/etc/php/conf.d/docker-php-ext-pdo_pgsql.ini, /usr/local/etc/php/conf.d/docker-php-ext-pdo_sqlsrv.ini, /usr/local/etc/php/conf.d/docker-php-ext-pgsql.ini, /usr/local/etc/php/conf.d/docker-php-ext-rdkafka.ini, /usr/local/etc/php/conf.d/docker-php-ext-redis.ini, /usr/local/etc/php/conf.d/docker-php-ext-soap.ini, /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini, /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini, /usr/local/etc/php/conf.d/docker-php-ext-sqlsrv.ini, /usr/local/etc/php/conf.d/docker-php-ext-tideways_xhprof.ini, /usr/local/etc/php/conf.d/docker-php-ext-tidy.ini, /usr/local/etc/php/conf.d/docker-php-ext-uploadprogress.ini, /usr/local/etc/php/conf.d/docker-php-ext-uuid.ini, /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini, /usr/local/etc/php/conf.d/docker-php-ext-xmlrpc.ini, /usr/local/etc/php/conf.d/docker-php-ext-xsl.ini, /usr/local/etc/php/conf.d/docker-php-ext-yaml.ini, /usr/local/etc/php/conf.d/docker-php-ext-zip.ini, /usr/local/etc/php/conf.d/docker-php.ini, /usr/local/etc/php/conf.d/z-docker-php-ext-event.ini
PHP API 20190902
PHP Extension 20190902
Zend Extension 320190902
Zend Extension Build API320190902,NTS
PHP Extension Build API20190902,NTS
Debug Build no
Thread Safety disabled
Zend Signal Handling enabled
Zend Memory Manager enabled
Zend Multibyte Support provided by mbstring
IPv6 Support enabled
DTrace Support disabled
Registered PHP Streams https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, sqlsrv, zip, phar, public, temporary, translations, youtube, vimeo, dailymotion, vine, instagram, facebook, private
Registered Stream Socket Transports tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3
Registered Stream Filters

zlib.*, convert.iconv.*, bzip2.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, mcrypt.*, mdecrypt.*

 

and the xdebug part :

Version 3.0.4
Support Xdebug on Patreon, GitHub, or as a business
Enabled Features
(through 'xdebug.mode' setting)
Feature Enabled/Disabled Docs
Development Aids ✘ disabled 🖹
Coverage ✘ disabled 🖹
GC Stats ✘ disabled 🖹
Profiler ✘ disabled 🖹
Step Debugger ✘ disabled 🖹
Tracing ✘ disabled 🖹
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 172.17.0.1 172.17.0.1
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 /var/www/html/xdebug.log /var/www/html/xdebug.log
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 /mnt/files/xdebug /mnt/files/xdebug
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.var_display_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth 3 3
0
Comment actions Permalink

@laurent CULOTO

Accordingly to your Xdebug from phpinfo .. it is disabled.

Step Debugger
✘ disabled
🖹

Try enabling it:

0
Comment actions Permalink

I'm using a docker-compose.yml to put in my php.ini infos, in the php container, like so :


php:
image: wodby/drupal-php:$PHP_TAG
container_name: "${PROJECT_NAME}_php"
environment:
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S espace_rentiers_mailhog:1025
PHP_XDEBUG: 1
PHP_XDEBUG_DEFAULT_ENABLE: 1
PHP_XDEBUG_REMOTE_CONNECT_BACK: 0
PHP_XDEBUG_REMOTE_PORT: 9000
PHP_IDE_CONFIG: serverName=phpstorm
PHP_XDEBUG_IDEKEY: "phpstorm"
PHP_XDEBUG_REMOTE_HOST: host.docker.internal
PHP_XDEBUG_LOG: /var/www/html/xdebug.log
volumes:
- ./:/var/www/html:cached
- ./config/docker-local/settings.local.php:/var/www/html/docroot/sites/default/settings.local.php

Could you tell me what is the correct variable to enable it, as

PHP_XDEBUG_DEFAULT_ENABLE: 1

seems not working anymore ?

0
Comment actions Permalink

@laurent CULOTO

I'm not familiar with wodby/drupal-php image so do not know how it works / how it passes the Xdebug params/where you specify them ... but "PHP_XDEBUG_DEFAULT_ENABLE" and other names suggest me that it may still be using Xdebug v2 parameter names ... while you have Xdebug v3.

They definitely do not work: because you have PHP_XDEBUG_REMOTE_PORT: 9000 while Xdebug 3 live config clearly shows default 9003 port specified. Same with PHP_XDEBUG_REMOTE_HOST -- host.docker.internal vs IPv4 in the live config.

Please check Xdebug: Upgrading from Xdebug 2 to 3  for correct parameters names for Xdebug v3.

0

Please sign in to leave a comment.