View Issue Details

IDProjectCategoryView StatusLast Update
0001840XdebugStep Debuggingpublic2020-08-31 15:50
Reportercheddam Assigned Toderick  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
PlatformDockerOSmacOS (Host), Debian (Container)OS Version10.15.6, 10.5
Summary0001840: remote_enable seems to be ignored under Xdebug 3 / PHP 8 configuration
Description

I'm attempting to use Xdebug 3 to analyse PHP 8 compatibility issues in the Silverstripe CMS project. I've set up a Docker image to drive this, and am running IntelliJ IDEA (equivalent of PHPStorm) on the host machine with Xdebug enabled.

Unfortunately, despite applying the following config both in a XDEBUG_CONFIG environment variable and later directly in the php.ini, I've been unable to get Xdebug to connect to IDEA, and I'm not even able to get remote logs working.

I validated via telnet that the Docker container is able to connect back to the host using the specified hostname and port (host.docker.internal / 9000). IDEA's built-in Xdebug Config Checker states that xdebug.remote_enable needs to be set to 1 (despite this already being the case.)

Steps To Reproduce
  1. Install Docker if necessary, ensure you have an IDE running on the host and listening for Xdebug connections on port 9000
  2. Clone https://github.com/Cheddam/silverstripe-php8-env, run the brief setup steps in the README to get the project installed and the Docker containers running
  3. Set a breakpoint in the top of build/vendor/bin/phpunit
  4. Enter the Docker container (docker exec -it silverstripe-php8-env_web_1 /bin/bash)
  5. Run php -v and note that Xdebug is installed and enabled
  6. Run vendor/bin/phpunit and observe that Xdebug does not attempt to connect to the IDE

I've tried appending the following to the Dockerfile to set config directly:

RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_autostart=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_mode=req" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.log=/var/www/html/xdebug.log" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.log_level=10" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_log=/var/www/html/xdebug-remote.log" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.remote_log_level=10" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

xdebug.log is populated, but xdebug-remote.log is not.

Additional Information

Weirdly, the remote_enable setting isn't even listed in phpinfo() output, nor the remote_log setting. Is there a way to build the xdebug extension that doesn't include the remote capabilities, that I might have accidentally invoked?

TagsNo tags attached.
Operating System
PHP Version8.0-dev

Activities

derick

2020-08-31 09:40

administrator   ~0005450

Please read the upgrading guide: https://3.xdebug.org/docs/upgrade_guide — Also note that Xdebug 3 has not been released, not even as alpha.

cheddam

2020-08-31 11:46

reporter   ~0005451

Ah, wish I'd found that before bothering you! Thanks for the pointer :)

(Totally aware that I'm dealing with prerelease software here - just trying to get ahead of the curve on PHP 8 support!)

derick

2020-08-31 15:50

administrator   ~0005452

No prob. Testing alpha software is a good idea. I saw your question on IRC, but it was in the middle of the night. I'd love the feedback for Xdebug 3 (usability, functionality, etc), but it's probably best to not have that in the issue tracker. Feel free to email me too. (derick at...)

Issue History

Date Modified Username Field Change
2020-08-31 06:08 cheddam New Issue
2020-08-31 09:40 derick Assigned To => derick
2020-08-31 09:40 derick Status new => closed
2020-08-31 09:40 derick Resolution open => no change required
2020-08-31 09:40 derick Note Added: 0005450
2020-08-31 11:46 cheddam Note Added: 0005451
2020-08-31 15:50 derick Note Added: 0005452