PHPStorm
On Tap Cloud DX supports remote development using PHPStorm.
Connecting to your Cloud DX Server
- In the initial project browser, expand "Remote Development" and click on the "SSH" option...
- Click on the "New Connection" button.
- Enter "ontap" into the "Username" field.
- Enter your Cloud DX Server's IP address into the "Host" field (which can be found on your onboarding email).
- Click on the "Specify private key" checkbox, and make sure the relevant key is selected.
- Your window should look similar to this...
- Click on the "Check Connection and Continue" button.
- You will eventually see...
- Ensure that the "IDE version" is set to a version that matches closely "PhpStorm 2022.3". Please note, IDE versions of 2023 are not currently supported.
- Enter your project's directory, which will be something like
/home/ontap/projects/project-name
. - Click on the "Download IDE and Connect" button.
- PhpStorm now installs and connects to the remote server.
Please note:
- Once you have done the above process once for your Cloud DX Server, then most of these steps will be skipped.
- It is normal to receive "high load" warnings when you connect to a project for the first time, since the PhpStorm server-side software indexes the entire site. It normally takes a few minutes only.
Using Xdebug
- Inside your project directory, execute the command
dx xdebug on
. - You can start debugging by using the menu option Run → Start Debugging (also available on the keyboard shortcut F5).
- Now insert a breakpoint somewhere, for example in
pub/index.php
... - In the bottom right of the window, click on the PHP Debug icon, which will initially look like this...
- The icon will change to this...
- Now load up the website in your web browser.
- This should trigger an "Incoming Connection From Xdebug" popup...
- Click on the "Accept" button.
- You should now see the code breakpoint has been triggered...
Turning Xdebug off
Performance is affected whilst Xdebug is enabled. Therefore, it is good practice to disable it when you do not need to debug. You can do that by executing the command dx xdebug off
.