I’m trying to config Xdebug 3
in PHP container, and set XDEBUG_MODE
env variable to off
according with documentation https://xdebug.org/docs/all_settings#mode but xdebug_info()
shows that mode=develop
. How to fix?
Dockerfile:
FROM php:7.4.11-fpm
…
ENV XDEBUG_MODE=off
ENV XDEBUG_CONFIG=""
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug \
...
docker-compose.yml:
services:
php:
build:
dockerfile: ${PWD}/.devcontainer/Dockerfile
image: php-fpm
environment:
XDEBUG_MODE: ${XDEBUG_MODE} // off
XDEBUG_CONFIG: ${XDEBUG_CONFIG}
xdebug info:
php -r 'xdebug_info();'
Version => 3.0.0
Support Xdebug on Patreon, GitHub, or as a business: https://xdebug.org/support
Feature => Enabled/Disabled
Development Aids => ✘ disabled
Coverage => ✘ disabled
GC Stats => ✘ disabled
Profiler => ✘ disabled
Step Debugger => ✘ disabled
Tracing => ✘ disabled
PHP
Build Configuration
Version => 7.4.11
Debug Build => no
Thread Safety => disabled
Settings
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-xdebug.ini,
Directive => Local Value => Master Value
xdebug.mode => develop => develop
UPDATE:
My case: I use VSCode to debug my app, so I need to turn on Xdebug module only when Xdebug listening is active. Better way to do that is using env XDEBUG_CONFIG and XDEBUG_MODE, because it not require change ini files.