Written by James McDonald

May 24, 2023

There are three configurations this post covers

Local Development

Use the default if working locally

If you are using CakePHP 4 and developing on the local file system (straight from Windows) use this:


If your project is in C:\Users\ja.TGNT\cake_test you get a URL as follows on a Windows 11 System



To get to a file hosted in WSL you have to make sure the link targets the full path to the file in the WSL environment.

In this case I have the source code being served from a folder in WSL via a Docker container.

So I have to remove the CakePHP 4 ROOT (/var/www/wms) and prepend the WSL path to that mounted folder.

Debugger::addEditor('wsl', function ($file, $line) {
    $file = str_replace(ROOT, '', $file);

    $prefix = '/home/ja/dev/wms';

    return "vscode://vscode-remote/wsl+Ubuntu-22.04{$prefix}{$file}:{$line}";


An example of a URL for WSL


Note the /wsl+Ubuntu-22.04 which is the Windows Subsystem for Linux Distribution being used

Windows 11 Host and Docker using WSL2 Engine

This will allow you to attach to a running docker Development container

Debugger::addEditor('docker', function ($file, $line) {
    $container = [
        'containerName' => 'wms-php-1'

    $json = json_encode($container);

    $hex = bin2hex($json);

    return "vscode://vscode-remote/attached-container+{$hex}{$file}:{$line}";


An example of a URL for attaching to a running Docker container





Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Network speed test host to host

On Ubuntu / Debian apt-get install iperf3 On Windows download it from https://iperf.fr/iperf-download.php#windows Make...

Clear HSTS Settings in CHrome

Open chrome://net-internals/#hsts enter the domain in the query field and click Query to confirm it has HSTS settings...