How to get Xdebug working with Visual Studio Code?

I think you should be using something like this

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
	{
		"name": "Listen for XDebug",
		"type": "php",
		"request": "launch",
		"port": 9000,
		// "stopOnEntry": true,
		"pathMappings": {
			"/var/www/html": "${workspaceRoot}",
			"/app": "/Users/ahmadawais/Documents/Web/Dev/Local/courses/app/"
		}
	},
	{
		"name": "Launch currently open script",
		"type": "php",
		"request": "launch",
		"program": "${file}",
		"cwd": "${fileDirname}",
		"port": 9000
	}
]

}

1 Like