You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,8 +42,7 @@ In your project, go to the debugger and hit the little gear icon and choose _PHP
42
42
-`request`: Always `"launch"`
43
43
-`port`: The port on which to listen for XDebug (default: `9000`)
44
44
-`stopOnEntry`: Wether to break at the beginning of the script (default: `false`)
45
-
-`localSourceRoot`: The path to the folder that is being served by your webserver and maps to `serverSourceRoot` (for example `"${workspaceRoot}/public"`)
46
-
-`serverSourceRoot`: The path on the remote host where your webroot is located (for example `"/var/www"`)
45
+
-`pathMappings`: A list of server paths mapping to the local source paths on your machine, see "Remote Host Debugging" below
47
46
-`log`: Wether to log all communication between VS Code and the adapter to the debug console. See _Troubleshooting_ further down.
48
47
-`ignore`: An optional array of glob patterns that errors should be ignored from (for example `**/vendor/**/*.php`)
49
48
-`xdebugSettings`: Allows you to override XDebug's remote debugging settings to fine tuning XDebug to your needs. For example, you can play with `max_children` and `max_depth` to change the max number of array and object children that are retrieved and the max depth in structures like arrays and objects. This can speed up the debugger on slow machines.
@@ -82,10 +81,13 @@ Remote Host Debugging
82
81
---------------------
83
82
To debug a running application on a remote host, you need to tell XDebug to connect to a different IP than `localhost`. This can either be done by setting [`xdebug.remote_host`](https://xdebug.org/docs/remote#remote_host) to your IP or by setting [`xdebug.remote_connect_back = 1`](https://xdebug.org/docs/remote#remote_connect_back) to make XDebug always connect back to the machine who did the web request. The latter is the only setting that supports multiple users debugging the same server and "just works" for web projects. Again, please see the [XDebug documentation](https://xdebug.org/docs/remote#communcation) on the subject for more information.
84
83
85
-
To make VS Code map the files on the server to the right files on your local machine, you have to set the `localSourceRoot` and `serverSourceRoot` settings in your launch.json. Example:
84
+
To make VS Code map the files on the server to the right files on your local machine, you have to set the `pathMappings` settings in your launch.json. Example:
86
85
```json
87
-
"serverSourceRoot": "/var/www/myproject",
88
-
"localSourceRoot": "${workspaceRoot}/public"
86
+
// server -> local
87
+
"pathMappings": {
88
+
"/var/www/html": "{workspaceRoot}/www",
89
+
"/app": "{workspaceRoot}/app"
90
+
}
89
91
```
90
92
Please also note that setting any of the CLI debugging options will not work with remote host debugging, because the script is always launched locally. If you want to debug a CLI script on a remote host, you need to launch it manually from the command line.
0 commit comments