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 ?
Please sign in to leave a comment.
Could you please share your dockerized web server's
phpinfo()output?This is the php part, on top :
PHP Version 7.4.21
zlib.*, convert.iconv.*, bzip2.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, mcrypt.*, mdecrypt.*
and the xdebug part :
(through 'xdebug.mode' setting)
@laurent CULOTO
Accordingly to your Xdebug from phpinfo .. it is disabled.
Try enabling it:
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 ?
@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.