LoginSignup
33
16

More than 1 year has passed since last update.

Xdebug3.0.0がリリースされたので、ver2からの雑な設定コンバート

Last updated at Posted at 2020-11-26

Xdebug 3.0.0 is out!

11/25にXdebug 3.0.0 is out!されたわけですが、pecl install xdebugと記載していて、まんまと勝手にver3がインストールされてしまい、まんまと以前の設定で動かず焦っている今日この頃ですが皆さんいかがお過ごしでしょうか?

そんなわけで、私が使用している設定をコンバートし、ひとまず変更を加えて動くところまで雑にやって、雑にまとめました。

mode設定

ver2.x系でとりあえずステップデバッグを使うためには、下記の設定を行っていたと思います。いや、むしろこれがほぼすべてと言ってもよいくらい。

xdebug.remote_enable=1
xdebug.default_enable=0
xdebug.profiler_enable=0
xdebug.auto_trace=0
xdebug.coverage_enable=0

ver3.x系では

xdebug.mode=debug

となります。

modeにいくつかの設定が集約されたようで、そのvalueの記載でフラグを管理していく感じです。

以前の設定とmodeのvalueのコンバートはこう。

以前の設定 modeのvalue
default_enable develop
profiler_enable profile
remote_enable debug

同時に設定したい場合はvalueをカンマ区切り。

xdebug.mode=develop,debug

その他コンバートが必要だったもの

xdebug.remote_autostartを設定する場合、下記の2つを設定するようです。

  • xdebug.mode=debug
  • xdebug.start_with_request=yes

だいたいの人が必要そうな設定はこちらです。

以前の設定 新しい設定
profiler_output_dir output_dir
remote_host client_host
remote_port client_port

output_dir系はoutput_dirにまとめられたっぽいです。

ここまでの設定でブレークポイントまでは動かすことができました。

ポート番号

私はポートを指定していたので引っかからなかったのですが、デフォルトのポート番号が9003へ変更になっています。

参考

参考にしたのは公式ドキュメント。
結局、必要な設定を検索しながらポチポチ地道に書き換えていくしかなさそうです。

動いたini

最期にXdebugが動作したiniを記載しておきます。
開発環境はPhpStormで、Dockerサーバーです。

xdebug.client_host=host.docker.internal 
xdebug.client_port=9010 
xdebug.idekey=PHPSTORM 
xdebug.mode=debug,develop 

Profilerの設定

Xdebug3.xでProfilerを動かす雑な設定を公開しましたので合わせてご覧ください。

33
16
2

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
33
16