LoginSignup
0

More than 3 years have passed since last update.

xdebug3 でデバッグする

Posted at

いつのまにか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

参考

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0