MGT Cloud Log is here!

Debugging with Xdebug

Xdebug is the tool number one for our daily work as a developer. It's very easy to make it work with our MGT Development Environment. Just follow the 3 steps to get it work.

Debugging with Xdebug

Step 1: Login with ssh into container

ssh root@
Password: root

Step 2: Enable Xdebug and set remote_host in php.ini

nano /etc/php/7.2/fpm/php.ini

# At the end of the file set xdebug.remote_enable to true

# Add your local host ip here

How do I find my local host ip on mac?

To get your local host ip click on your wifi symbol top right --> Open Network Preferences

Local Host IP

Step 3: Restart php-fpm

pkill php && /etc/init.d/php-fpm restart

Step 4: Create Debugging Configuration

In our example, we will explain how to configure Xdebug with PhpStorm.

The first step is to click in the top menu on Run --> Edit Configurations.

From there you create a new PHP Web Application Configuration:

PhpStorm PHP Web Application Configuration

When you create the "Server" make sure to use path mappings:

PhpStorm Server Configuration

Step 5: Start Debugging

You can now start debugging with Xdebug. PhpStorm listens on Port 9000 and the docker container sends all data to the IDE.