2
3

More than 5 years have passed since last update.

Docker for Mac (Windows) 上のPHPアプリをデバッグ実行する

Last updated at Posted at 2018-08-23

Docker for Mac/Windowsで動作しているPHPアプリを、VS Codeからデバッグする方法です。

Docker for Mac/Windowsで起動したコンテナでは、host.docker.internalというDNS名で、ホストのIPアドレスを引くことができるようになっています。

Xdebug の設定のxdebug.remote_hostに、この値を指定することで、コンテナ内のPHPとデバッガが通信できるようになります。

xdebug.default_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 0
xdebug.remote_enable = 1
xdebug.remote_host = "host.docker.internal"
xdebug.remote_port = 9000

img5.png

仮想環境でのPHPデバッグについて、詳しくは、Vagrant(+Docker) 上のPHPアプリをデバッグ実行するをご覧ください。

2
3
0

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
2
3