skip to Main Content

When I start the debugger on VSCode everything seems to be working as the lower bar becomes orange etc… However, when I add a breakpoint the site ignores it and keeps the loading normally. When I go to add a config on launch.json php doesn’t appears either. Xdebug doesn’t creates the log.

I have double-checked all the paths, downloaded the dll of Xdebug and added the necessary lines on the php.ini, settings.json and launch.json.

php -v gives me the version 7.3.5 and on WAMP it’s the same version (verified on desktop and http://localhost/?phpinfo=-1)

settings.json

{
    "telemetry.enableTelemetry": false,
    "terminal.integrated.shell.windows": "C:\WINDOWS\System32\cmd.exe",
    "window.zoomLevel": -1,
    "C_Cpp.updateChannel": "Insiders",
    "arduino.path": "C:\Program Files (x86)\Arduino",
    "[javascript]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "[html]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "editor.minimap.enabled": false,
    "php.validate.enable": true,
    "php.executablePath": "c:/wamp64/bin/php/php7.3.5/php.exe",
    "php.validate.executablePath": "c:/wamp64/bin/php/php7.3.5/php.exe",
    "php.validate.run": "onSave",
    "files.associations": {
        "*.inc": "php"
    },
    "git.autofetch": true,
    "git.enableSmartCommit": true
}

launch.json

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

php.ini

[XDebug]
zend_extension="c:/wamp64/bin/php/php7.3.5/ext/php_xdebug-2.8.0beta2-7.3-vc15-x86_64.dll"
xdebug.remote_enable = 1
xdebug.remote_autostart=on
xdebug.remote_port = 9000
xdebug.remote_log="c:/"

I don’t get any error messages either.

2

Answers


  1. For making a log: The webserver is probably not allowed to write to c:/ – you probably want to use c:/temp (or whatever your temporary directory path is).

    As for not stopping, it is possible that the paths for your webserver and locally on your hard drive are not the same, and you need to set up a “path mapping”: https://github.com/felixfbecker/vscode-php-debug/blob/master/README.md#remote-host-debugging

    Login or Signup to reply.
  2. I was struggling with this issue for over a year but found the problem in my case.

    VSCode python debugger will only recognize either CRLF or LF at the end of lines but not both. The debugger will appear to skip lines (but they are still executed) when there is a mix of the two in the file. This was happening in my case because I was adding lines of code while inside a debugging session and when I saved the file with the debugger session still live the end of line characters were different than the default in the file.

    To solve it I simply had to change the line feed setting on right side of the bottom blue bar in VSCode from CRLF to LF back to CRLF and save the file.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search