Toshio Blog

Remote Debugger With Phpstorm And Vagrant

September 06, 2018

前回の続きで、今回はVagrantで作成した仮想環境内にDockerをインストールして、その中でphpコンテナ、nginxコンテナを用意してリモートデバッグをした記事になります。

動作環境

  • Docker (Docker version 18.06.0-ce, build 0ffa825)
  • Docker-Compoe (docker-compose version 1.21.2, build a133471)
  • Vagrant (Version: 2.1.1)
  • PhpStorm (Version: PhpStorm 2018.1.6)

PHPが動作しているコンテナでxdebug.iniを適用

; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini)
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.cli_color=0
xdebug.profiler_enable=0
xdebug.profiler_output_dir="~/xdebug/phpstorm/tmp/profiling"
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.var_display_max_children=-1
xdebug.var_display_max_data=-1
xdebug.var_display_max_depth=-1
view raw xdebug.ini hosted with ❤ by GitHub

その他は前回と同様になります。


Written by Ta Toshio who lives and works in Saitama, Japan .You should follow him on Twitter