Feb 02, 2022 · After a request to our docker container, Xdebug will initiate a connection with our IDE. In our case, we will be using Visual Studio Code with PHP Tools. Dockerfiles We'll be using PHP with Nginx, just like in our previous article. Let's start by modifying PHP Dockerfile: FROM php:fpm RUN pecl install xdebug RUN docker-php-ext-enable xdebug.
Web. VSCode and Xdebug We can proceed now to open VSCode. On VSCode make sure to have installed the PHP Debug extension. Next, click on Open folder... and locate the folder we just created above and select it. You should see the two files "Dockerfile" and "index.php" Open the "index.php" file.