PHP + XDebug + VS Code¶
安装¶
PHP 安装 XDebug 扩展¶
VS Code 安装 XDebug 扩展¶
扩展:
- 名称:PHP Debug
- ID:felixfbecker.php-debug
配置¶
PHP 扩展¶
; 工作模式
xdebug.mode=develop,debug
xdebug.client_host=x.x.x.x
xdebug.client_discovery_header=""
xdebug.discover_client_host=true
xdebug.client_port=9003
; 开启 XDebug 运行状态日志
xdebug.log=xdebug.log
; 启动方式选其一:
; 1)自动启动
xdebug.start_with_request=yes
; 2)触发启动
xdebug.start_with_request=trigger
VS Code¶
{
"version": "0.2.0",
"configurations": [
{
"name": "XDebug",
"type": "php",
"request": "launch",
"pathMappings": {
"/project": "${workspaceFolder}"
},
},
],
}