Skip to content

Commit 3e968a1

Browse files
authored
Merge pull request #445 from ByteInternet/add-seperation-for-phpstorm-and-vscode-for-remote-debugging
Add seperation Xdebugging for phpstorm and vscode
2 parents 6bf88db + 350c80a commit 3e968a1

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

docs/hypernode-platform/php/remote-debugging.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ If you're not using Xdebug cloud, you need to open a reverse SSH tunnel so that
5252
$ ssh -R 9003:localhost:9003 [email protected] -N
5353
```
5454

55-
### Configure PhpStorm
55+
### IDEs
56+
57+
#### PhpStorm
5658

5759
Then you open up your PhpStorm project and go to your *File -> Settings -> PHP -> Servers*. Click the *+* button to add a server and fill *Name* and *Host* with the full domain name of the site you want to debug (for example www.shop.com). Then check the box *Use path mappings* and click on the right column next to your project root. Here you can fill in the absolute path of the application on the remote server, for example:
5860

@@ -72,6 +74,29 @@ Finally click the *Start Listening for PHP Debug Connections* button. Now your d
7274

7375
![](_res/phpstorm-listen-for-debug.png)
7476

77+
#### Visual Studio Code
78+
79+
If you prefer Visual Studio Code, you can use the PHP Debug extension. Create or update `.vscode/launch.json` in your project with the following configuration and adjust `pathMappings` to your remote application path:
80+
81+
```json
82+
{
83+
"version": "0.2.0",
84+
"configurations": [
85+
{
86+
"name": "Listen for XDebug",
87+
"type": "php",
88+
"request": "launch",
89+
"port": 9003,
90+
"pathMappings": {
91+
"/data/web/releases/1767778825": "${workspaceRoot}"
92+
}
93+
}
94+
]
95+
}
96+
```
97+
98+
After saving, open the *Run and Debug* panel, choose **Listen for XDebug**, and start listening for incoming debug connections on port 9003.
99+
75100
### Start debugging
76101

77102
To start debugging, make sure you have the Xdebug helper extension enabled in your browser:

0 commit comments

Comments
 (0)