WORKSPACE_INSTALL_XDEBUG=true PHP_FPM_INSTALL_XDEBUG=true
docker-compose build php-fpm workspace
使配置生效編輯 laradock/workspace/xdebug.ini 及 laradock/php-fpm/xdebug.ini,具體配置以下php
xdebug.remote_host=docker.for.win.localhost xdebug.remote_connect_back=0 xdebug.remote_port=9000 xdebug.idekey=PHPSTORM xdebug.remote_autostart=0 xdebug.remote_enable=0 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
其中 remote_host 很關鍵。我使用的是 windown,如使用 Mac 應修改成 docker.for.mac.localhost(ps:能夠在未配置成功的狀況下,運行西面的vildate 根據他的提示,填寫
remote_host
)
laravel
配置 PHP server,具體配置如圖docker
配置、驗證 Xdebug瀏覽器