Debugging Setup in Docker
Running Spryker containers with Xdebug enabled
Run containers:
docker/sdk up -x
If containers are already running, the fastest option is to run docker/sdk run -x .
Configuring Xdebug in PhpStorm
Required Configuration
Open Preferences → Languages & Frameworks → PHP → Debug in PhpStorm and do the following:
-
In the Xdebug block:
- Depending on your requirements, change the Debug port value. It is set to "9000" by default.
- If not selected, select the Can accept external connections checkbox.
- If selected, unselect 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:
- Increase Max. simultaneous connection from 4 to 5.
- If selected, unselect the Ignore external connections through unregistered server configurations and Break at first line in PHP scripts checkboxes.
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 the "spryker" host from your ENV.
- 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
- Open Preferences → Languages & Frameworks → PHP.
- Add new remote PHP interpreter:
Server: "Docker"
Image name: "spryker_app:latest"
PHP interpreter path: php
-
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:
Last review date: Aug 06, 2019