vscode-php-debug icon indicating copy to clipboard operation
vscode-php-debug copied to clipboard

Running current test case on remote server

Open 3rd3 opened this issue 3 years ago • 1 comments
trafficstars

I am wondering whether it is possible to run the currently opened test case on the remote server and then attach to Xdebug without using SSH for remote debugging? Perhaps via an URL that is called in the browser with the script name as argument as a "Listen for Xdebug launcher"?

3rd3 avatar Mar 26 '22 00:03 3rd3

What you can do is, if you have the code both on server and locally, run the script on the server (either from command line or from web server) and instruct Xdebug to connect to your PC. VSCode would in fact be showing your local code, but that should be the same as remote. You would probably need to play with "pathMappings".

There's a bunch of moving parts here...

zobo avatar Mar 26 '22 01:03 zobo

Just add a "terminal" SSH connection inside your workspace

    "terminal.integrated.profiles.windows": {
        "SSH@dev": {
            "args": [
                "-A",
                "-R",
                "9003:localhost:9003",
                "[email protected]"
            ],
            "overrideName": true,
            "path": "C:\\Programs\\Cygwin\\bin\\ssh.exe",
            "color": "terminal.ansiCyan"
        }
    },

Then you will get both an actual terminal and xdebug connector. Then it's a matter of setting up correct tasks to run currently opened test case and connect to debugger.

AnrDaemon avatar Nov 08 '22 14:11 AnrDaemon

Seems to be answered, closing.

zobo avatar Dec 29 '22 16:12 zobo