Application Packaging Standard

Last updated 18-Mar-2019

PHP Debugger

The PHP debugger embedded into IDE allows you to debug PHP scripts on the application backend (provisioning scripts). For this purpose, the IDE must have an open TCP port to accept external connections from the APS application instance. If the default port 9000 is busy on your local computer, set another free TCP port:

  1. Open the PhpStorm preferences and navigate to Languages & Frameworks > PHP > Debug.

  2. In the Xdebug section, set the needed Debug port.

    ../../../../_images/debug-tcp.png
  3. Click OK to save the configuration.

  4. Run the new deployment or update an existing deployed package on the deployment target.

The debugging process looks as follows.

  1. Ensure the package is deployed on a deployment target and on the endpoint host, that is the Deploy end-point on selected deployment target option was selected. Also, ensure the debug configuration is running.

    Application resources can be provisioned or not depending on the provisioning operation you are debugging. For example, if the provisioning logic fails to install even an application instance, then there are no application resources yet and you have to debug the corresponding script responsible for it.

  2. In IDE, open the respective PHP script and set debug breakboints there. To set a breakpoint on a line, click on the sidebar opposite this line.

    ../../../../_images/breakpoint-add.png
  3. Sync the package update with the deployment target.

  4. Run the operation you are going to debug. For example, open the control panel on the deployment target and start provisioning or unprovisioning of a resource.

    The provisioning PHP script must stop on the breakpoint as in this example:

    ../../../../_images/debug-breakbpoint-stop.png

This allows you to continue with typical debug steps.