Primary tabs

How to setup XDebug to work with ddev in VSCode and Cursor

By superadmin, 17 พฤศจิกายน, 2024

Enable the extension in your IDE: 

Name: PHP Debug (open this link to install the extesion)
Id: xdebug.php-debug
Description: Debug support for PHP with Xdebug
Version: 1.35.0
Publisher: xdebug

Create the file in the root of your project: .vscode/launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "port": 9003,
            "pathMappings": {
                "/var/www/html": "${workspaceFolder}"
            },
            "hostname": "0.0.0.0",
            "log": true,
            "xdebugSettings": {
                "max_children": 128,
                "max_data": 512,
                "max_depth": 3
            }
        }
    ]
}

Get in touch with us for assistance

Submit this webform:

By submitting this form i agreed the following