Setting up xdebug in VS Code with a bedrock installation using local flywheel

I’m trying to set up Xdebug, but I’m missing something. Also couldn’t find any information for this set up. Hopefully, somebody can help me with this. :sweat_smile:

Installed versions:

  • VS Code 1.71.2
  • Local Flywheel (version 6.4.3+6116) with Xdebug + VS Code enabled
  • PHP version 7.4.30
  • Wordpress 6.0.2

folder structure

Local Sites
└── domain
    └── app
        └── public
            ├── .vscode
                └── launch.json
            ├── composer.json
            ├── config
            │   ├── application.php
            │   └── environments
            │       ├── development.php
            │       ├── staging.php
            │       └── production.php
            ├── vendor
            └── web
                ├── app
                │   ├── mu-plugins
                │   ├── plugins
                │   ├── themes
                │   └── uploads
                ├── wp-config.php
                ├── index.php
                └── wp

launch.json

{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "Listen for Xdebug 3.0 (Local)",
			"type": "php",
			"request": "launch",
			"port": 9003,
			"pathMappings": { 
				"/app/web": "${workspaceFolder}", }
			,
			"xdebugSettings": {
				"max_children": 128,
				"max_data": 1024,
				"max_depth": 3,
				"show_hidden": 1
			}
		},
		{
			"name": "Listen for Xdebug (Local)",
			"type": "php",
			"request": "launch",
			"port": 9000,
			"pathMappings": { 
				"/app/public/web": "${workspaceFolder}", 
			},
			"xdebugSettings": {
				"max_children": 128,
				"max_data": 1024,
				"max_depth": 3,
				"show_hidden": 1
			}
		},
		{
			"name": "Launch currently open script",
			"type": "php",
			"request": "launch",
			"program": "${file}",
			"cwd": "${fileDirname}",
			"port": 9000,
			"xdebugSettings": {
				"max_children": 128,
				"max_data": 1024,
				"max_depth": 3,
				"show_hidden": 1
			}
		}
	]
}

@jlcara if its worth anything, I have installed it using Brew, following this manual - Xdebug - Laravel Herd

I think its transparent to HERD, meaning no need for herd to be installed to run xdebug, but you do need brew and pecl working fine (mine had several errors, which i had to fix to be able to execute the command).

I’m replying to this thread, for anyone who will stumble upon this thread.
XDEBUG does not suppose to be a part of your project. Its suppose to be linked to your php.ini of your running php which php, and have to be configured inside your launch.json. Thats it.