WORKSPACE_INSTALL_XDEBUG=true
PHP_FPM_INSTALL_XDEBUG=true
docker-compose build php-fpm workspace
使配置生效编辑 laradock/workspace/xdebug.ini 及 laradock/php-fpm/xdebug.ini,具体配置如下
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
)
配置 PHP server,具体配置如图
配置、验证 Xdebug
原文:https://www.cnblogs.com/yifan72/p/11393303.html