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浏览器