Xdebug FPM: start_with_request=trigger (no connect timeout without IDE)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-11 18:42:53 +01:00
co-authored by Claude Opus 5.5
parent 8040225ace
commit 729e4b3316
+4 -2
View File
@@ -44,10 +44,12 @@ COPY ./php-custom.ini /usr/local/etc/php/conf.d/php-custom.ini
# Xdebug: off by default on CLI (drush, composer) — mode=debug alone still hooks every # Xdebug: off by default on CLI (drush, composer) — mode=debug alone still hooks every
# function call and is what makes CLI commands slow, even with start_with_request=trigger. # function call and is what makes CLI commands slow, even with start_with_request=trigger.
# Use `XDEBUG_MODE=debug XDEBUG_TRIGGER=1 drush ...` (see xdebugon/xdebugoff aliases) to debug a CLI run. # Use `XDEBUG_MODE=debug XDEBUG_TRIGGER=1 drush ...` (see xdebugon/xdebugoff aliases) to debug a CLI run.
# FPM loads an extra ini dir that restores mode=debug + start_with_request=yes for web requests. # FPM loads an extra ini dir: web debugging stays available (browser XDEBUG_SESSION trigger),
# but never tries to connect on its own — start_with_request=yes cost a ~15s connect timeout
# on every request served by a cold worker when no IDE listens on 9001.
RUN printf "xdebug.mode=off\nxdebug.start_with_request=trigger\n" > /usr/local/etc/php/conf.d/zz-xdebug-cli.ini && \ RUN printf "xdebug.mode=off\nxdebug.start_with_request=trigger\n" > /usr/local/etc/php/conf.d/zz-xdebug-cli.ini && \
mkdir -p /usr/local/etc/php/fpm-conf.d && \ mkdir -p /usr/local/etc/php/fpm-conf.d && \
printf "xdebug.mode=debug\nxdebug.start_with_request=yes\n" > /usr/local/etc/php/fpm-conf.d/zz-xdebug-fpm.ini printf "xdebug.mode=debug\nxdebug.start_with_request=trigger\n" > /usr/local/etc/php/fpm-conf.d/zz-xdebug-fpm.ini
# COPY ./php-fpm-custom.conf /usr/local/etc/php-fpm.d/php-fpm-custom.conf # COPY ./php-fpm-custom.conf /usr/local/etc/php-fpm.d/php-fpm-custom.conf