Debugging Setup in Docker
Edit on GitHubRunning Spryker containers with Xdebug enabled
Run containers:
docker/sdk up -x
Configuring Xdebug in PhpStorm
Required Configuration
Xdebug configuration
Open Preferences → Languages & Frameworks → PHP → Debug in PhpStorm and do the following:
- 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
Open Preferences → Languages & Frameworks → PHP → Servers in PhpStorm and do the following:
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.
Optional Configuration
Remote PHP interpreter Setup
- 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
-
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 use 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