Using the reference Docker files
Edit docker-compose.override.yml and set XDEBUG_ENABLED to true for the portal service.
Also make sure that the xdebug.ini configuration file is mounted.
services:
portal:
volumes:
- ./portal-files/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
environment:
XDEBUG_ENABLED: "true"
Edit the file portal-files/xdebug.ini and change the IP to match the IP of your Docker network interface.
Run docker-compose up -d
Without docker / Custom webserver
Install and enable the PHP extension xdebug and copy the configuration from portal-files/xdebug.ini.
IDE configuration
PHPStorm
Add a new PHP Remote Debug configuration
-
Go to
RunβEdit configurations. -
Click on the
Validatelink in the first list item. Enter the path to theportal/publicdirectory and for the URL usehttp://127.0.0.1:8080/or the URL to your Laravel application. -
Click on the
Validatebutton. All items should pass the test (Ignore the php.ini warning). -
Install the browser toolbar from the second point
-
Click
OK
Server configuration and path mappings
Go to File β Settings (CTRL + ALT + S)
Go to Languages & Frameworks β PHP β Servers
Add a new server, if your server isnβt listed yet.
When using a Docker container, enable Use path mappings and add the following mapping:
| File/Directory | Absolute path on the server |
|---|---|
portal |
/portal |
If you do development on a composer package (eg.: gentics/portal-php), and have installed the package with the composer symlink feature, you also have to add a mapping for the resolved symlink path:
| File/Directory | Absolute path on the server |
|---|---|
portal/vendor/my/example-package |
/example-package |
Start debugging
-
Go to
RunβStart Listening for PHP Debug connections -
Place a break point anywhere
-
Enable
Debugin the browser extension you installed and refresh the page
