Configuring debugging in Docker
Edit on GitHubThis document provides information about setting up the debugging for Spryker in Docker.
Xdebug is used to debug setup in Docker. To enable Xdebug, run the command:
docker/sdk {run|start|up} -x
Configuring Xdebug in PhpStorm - Required Configuration
This section describes the required configuration for Xdebug in PHPStorm.
Xdebug configuration
Follow the steps to configure Xdebug in PHPstorm:
-
Open Preferences → Languages & Frameworks → PHP → Debug.
-
In the Xdebug block:
a. Depending on your requirements, change the Debug port value. It is set to “9000” by default. b. If not selected, select the Can accept external connections checkbox. c. If selected, clear the Force break at first line when no path mapping specified and Force break at first line when a script is outside the project checkboxes.
-
In the External connections block:
a. Increase Max. simultaneous connection from 4 to 5. b. If selected, unselect the Ignore external connections through unregistered server configurations and Break at first line in PHP scripts checkboxes.
Servers configuration
Follow the steps to configure servers:
-
Open PHPStorm → Preferences → Languages & Frameworks → PHP → Servers.
-
Add a server:
- In the Name field, enter spryker.
- In the Host section, enter spryker.
- Select the Use path mappings checkbox.
- Set the absolute path to the
/data
folder on the server for the folder with your Spryker project files.
Configuring Xdebug in PhpStorm - Optional Configuration
This section describes the optional configuration for Xdebug in PHPStorm.
Remote PHP Interpreter Setup
Follw the steps to add a PHP interpreter:
- Open Preferences → Languages & Frameworks → PHP.
- Add new remote PHP interpreter: a. Server: “Docker” b. Image name: “spryker_app:latest” c. PHP interpreter path: php
Remote Debug configuration
Follow the steps to add a PHP Remote Debug configuration:
-
Open Run → Edit Configurations….
-
Add new PHP Remote Debug configuration.
-
Set the name to “spryker”.
-
Select the spryker server.
-
Set the PHPSTORM IDE key.
Debugging with Xdebug
To debug an application, do the following:
-
Make a breakpoint:
-
Click
-
Open the application in browser.
-
Navigate to the action for which you configured the breakpoint in step 1. The debugging process should be running in the IDE:
Thank you!
For submitting the form