Skip to content

Commit 86b926f

Browse files
authored
Merge pull request #212 from ByteInternet/xdebug_cloud
2 parents 730aa5e + f4b28ea commit 86b926f

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

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

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ myst:
55
Hypernode from your local machine.
66
title: Remote Debugging | Hypernode
77
keywords: hypernode, remote, debugging, xdebug, phpstorm, php, remote debugging,
8-
varnish
8+
varnish, xdebug cloud
99
---
1010

1111
# Remote Debugging
@@ -20,16 +20,40 @@ Debugging traffic will be routed to the PHP-FPM instance which has been configur
2020

2121
To enable remote debugging, you first have to enable the Xdebug setting:
2222

23+
### Enable Xdebug
24+
2325
```console
2426
app@abcdef-example-magweb-cmbl:~$ hypernode-systemctl settings php_xdebug_enabled True --block
2527
```
2628

27-
After that, you need to open a reverse SSH tunnel so that Xdebug on the Hypernode can communicate with PhpStorm on your local machine:
29+
### Setting up the connection
30+
31+
To connect your IDE to Xdebug on the Hypernode, you can either set up a reverse SSH tunnel or you can set up [Xdebug cloud](https://xdebug.cloud/).
32+
The latter is a paid service, but it’s very easy to set up and saves you the hassle of setting up a reverse SSH tunnel.
33+
34+
**Xdebug cloud**
35+
36+
Make sure you have an active Xdebug cloud subscription and key, then run the following command:
37+
38+
```console
39+
app@abcdef-example-magweb-cmbl:~$ hypernode-systemctl settings php_xdebug_cloud_key <your-key> --block
40+
```
41+
42+
Also make sure you configure your IDE to connect to Xdebug cloud:
43+
44+
- [PhpStorm](https://xdebug.cloud/docs#phpstorm)
45+
- [Visual Studio Code](https://xdebug.cloud/docs#vscode)
46+
47+
**Reverse SSH tunnel**
48+
49+
If you're not using Xdebug cloud, you need to open a reverse SSH tunnel so that Xdebug on the Hypernode can communicate with PhpStorm on your local machine:
2850

2951
```console
3052
$ ssh -R 9003:localhost:9003 app@example.hypernode.io -N
3153
```
3254

55+
### Configure PhpStorm
56+
3357
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:
3458

3559
- `/data/web/magento2`
@@ -48,6 +72,8 @@ Finally click the *Start Listening for PHP Debug Connections* button. Now your d
4872

4973
![](_res/phpstorm-listen-for-debug.png)
5074

75+
### Start debugging
76+
5177
To start debugging, make sure you have the Xdebug helper extension enabled in your browser:
5278

5379
- [Xdebug helper for Google Chrome](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en)

docs/hypernode-platform/tools/how-to-use-the-hypernode-systemctl-cli-tool.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ To see which values you can set and which values they are allowed to have take a
5050
- `php_version`: Change the PHP version
5151
- `php_apcu_enabled`: Enable the php-apcu module
5252
- `php_amqp_enabled`: Enable the php-amqp module
53+
- `php_xdebug_enabled`: Enable Xdebug for [remote debugging](../php/remote-debugging.md)
54+
- `php_xdebug_cloud_key`: Set the Xdebug cloud key for [remote debugging](../php/remote-debugging.md)
5355
- `redis_persistent_instance`
5456
- `redis_version`: Change the Redis version
5557
- `rabbitmq_enabled`: a popular open source message broker

0 commit comments

Comments
 (0)