いつのまにかxdebugが更新されて古い設定のままだと動かなくなってたのでiniファイルの変更点をざっくり
xdebug.ini
の変更点
変更前(xdebug2)
確かこんな感じ
zend_extension=xdebug
xdebug.remote_enable =1
xdebug.remote_autostart=1
xdebug.remote_host=host.docker.internal
xdebug.remote_port=9000
変更後(xdebug3)
動いた設定
zend_extension=xdebug
xdebug.mode=debug
xdebug.start_with_request=1
xdebug.client_host=host.docker.internal
xdebug.client_port=9003
デフォルトのポート番号も9000から9003に変更になっているようです。
IDE側を直すか、xdebug側を変えるかはお好みで。
前提
使用しているDockerfile
です。
FROM php:8.0-fpm
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug
COPY docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini