Remote debugging

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 RunEdit configurations.

  • Click on the Validate link in the first list item. Enter the path to the portal/public directory and for the URL use http://127.0.0.1:8080/ or the URL to your Laravel application.

  • Click on the Validate button. 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 FileSettings (CTRL + ALT + S)

Go to Languages & FrameworksPHPServers

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 RunStart Listening for PHP Debug connections

  • Place a break point anywhere

  • Enable Debug in the browser extension you installed and refresh the page