Skip to content

Commit

Permalink
Merge pull request #212 from ByteInternet/xdebug_cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
tdgroot authored Oct 5, 2023
2 parents 730aa5e + f4b28ea commit 86b926f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
30 changes: 28 additions & 2 deletions docs/hypernode-platform/php/remote-debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ myst:
Hypernode from your local machine.
title: Remote Debugging | Hypernode
keywords: hypernode, remote, debugging, xdebug, phpstorm, php, remote debugging,
varnish
varnish, xdebug cloud
---

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

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

### Enable Xdebug

```console
app@abcdef-example-magweb-cmbl:~$ hypernode-systemctl settings php_xdebug_enabled True --block
```

After that, you need to open a reverse SSH tunnel so that Xdebug on the Hypernode can communicate with PhpStorm on your local machine:
### Setting up the connection

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/).
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.

**Xdebug cloud**

Make sure you have an active Xdebug cloud subscription and key, then run the following command:

```console
app@abcdef-example-magweb-cmbl:~$ hypernode-systemctl settings php_xdebug_cloud_key <your-key> --block
```

Also make sure you configure your IDE to connect to Xdebug cloud:

- [PhpStorm](https://xdebug.cloud/docs#phpstorm)
- [Visual Studio Code](https://xdebug.cloud/docs#vscode)

**Reverse SSH tunnel**

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:

```console
$ ssh -R 9003:localhost:9003 [email protected] -N
```

### Configure PhpStorm

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:

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

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

### Start debugging

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

- [Xdebug helper for Google Chrome](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ To see which values you can set and which values they are allowed to have take a
- `php_version`: Change the PHP version
- `php_apcu_enabled`: Enable the php-apcu module
- `php_amqp_enabled`: Enable the php-amqp module
- `php_xdebug_enabled`: Enable Xdebug for [remote debugging](../php/remote-debugging.md)
- `php_xdebug_cloud_key`: Set the Xdebug cloud key for [remote debugging](../php/remote-debugging.md)
- `redis_persistent_instance`
- `redis_version`: Change the Redis version
- `rabbitmq_enabled`: a popular open source message broker
Expand Down

0 comments on commit 86b926f

Please sign in to comment.