Home » Php » visual studio code – Trouble enabling PHP Xdebug in VScode

visual studio code – Trouble enabling PHP Xdebug in VScode

Posted by: admin February 25, 2020 Leave a comment

Questions:

Currently, I use VScode with Remote SSH by Microsoft for my setup. For some reason, I am unable to get PHP Debug to do anything.

My launch.json files looks below


    {
        // 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,
                "log" : true
            },
            {
                "name": "Launch currently open script",
                "type": "php",
                "request": "launch",
                "program": "${file}",
                "cwd": "${fileDirname}",
                "port": 9000
            }
        ]
    }

Is there anything else I may need to do? The debug console request looks like below.

-> disconnectRequest
{
  command: 'disconnect',
  arguments: { restart: true },
  type: 'request',
  seq: 3
}

<- disconnectResponse
Response {
  seq: 0,
  type: 'response',
  request_seq: 3,
  command: 'disconnect',
  success: true
}

<- launchResponse
Response {
  seq: 0,
  type: 'response',
  request_seq: 2,
  command: 'launch',
  success: true
}
How to&Answers: