Tis is my launch.json file for xdebug in vscode studio
you need to add absolute file file
path to mt project folder: "/Users/singh/local/offcina/html"
{
"configurations": [
{
"name": "Docker Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/html": "/Users/singh/local/offcina/html",
},
}
]
}
this is my php.ini
[xdebug]
zend_extension = xdebug.so
xdebug.mode=${PHP_XDEBUG_MODE}
xdebug.start_with_request=yes
xdebug.client_host = ${PHP_XDEBUG_CLIENT_HOST}
xdebug.client_port=${PHP_XDEBUG_CLIENT_PORT}
xdebug.cli_color = ${PHP_XDEBUG_CLI_COLOR}
xdebug.idekey=VSCODE
xdebug.var_display_max_depth = ${PHP_XDEBUG_VAR_DISPLAY_MAX_DEPTH}
xdebug.max_nesting_level = ${PHP_XDEBUG_MAX_NESTING_LEVEL}
and this is my ENV under docker file
environment:
- "PHP_DISPLAY_ERRORS=Off"
- "PHP_XDEBUG_MODE=develop,debug"
- "PHP_XDEBUG_CLIENT_HOST=host.docker.internal"
- "PHP_XDEBUG_CLIENT_PORT=9003"
- "PHP_XDEBUG_CLI_COLOR=2"
- "PHP_XDEBUG_VAR_DISPLAY_MAX_DEPTH=20"
- "PHP_XDEBUG_MAX_NESTING_LEVEL=512"
- "PHP_IDE_CONFIG=serverName=docker-server"