From f4b28ea9cc89ddf7c8d188c7f26e9563e300c717 Mon Sep 17 00:00:00 2001 From: Timon de Groot Date: Tue, 3 Oct 2023 11:51:08 +0200 Subject: [PATCH] docs/remote-debugging: Add xdebug cloud docs --- .../php/remote-debugging.md | 30 +++++++++++++++++-- ...to-use-the-hypernode-systemctl-cli-tool.md | 2 ++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/docs/hypernode-platform/php/remote-debugging.md b/docs/hypernode-platform/php/remote-debugging.md index 336f2bb4..8d771e79 100644 --- a/docs/hypernode-platform/php/remote-debugging.md +++ b/docs/hypernode-platform/php/remote-debugging.md @@ -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 @@ -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 --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 app@example.hypernode.io -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` @@ -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) diff --git a/docs/hypernode-platform/tools/how-to-use-the-hypernode-systemctl-cli-tool.md b/docs/hypernode-platform/tools/how-to-use-the-hypernode-systemctl-cli-tool.md index dfc02f35..3e634791 100644 --- a/docs/hypernode-platform/tools/how-to-use-the-hypernode-systemctl-cli-tool.md +++ b/docs/hypernode-platform/tools/how-to-use-the-hypernode-systemctl-cli-tool.md @@ -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