Suppossing you have followed into the instructions mentioned into the following links:

  • Can't connect PhpStorm with xdebug with Docker
  • How to setup Docker + PhpStorm + xdebug on Ubuntu 16.04

Or similar questions

Then you need to follow theese steps:

Step1: Get shell access to your container via running:

docker exec -ti ^container_id^ /bin/sh

Or if running a debian/ubuntu based one (or you installed manually bash):

docker exec -ti ^container_id^ /bin/bash

The ^container_id^ can be found via docker ps command it is the first column of the table. If running on a small window just pipe int into less -S resulting the command:

docker ps | less -S

Then export the following enviromental variables:

export PHP_IDE_CONFIG="serverName=0.0.0.0:5092"
export XDEBUG_CONFIG="idekey=PHPSTORM"

Please keep in mind to setup the correct value specified into Servers section as you see in the image:

It is important in order not to run into the problem specified in this question.

Then just enable debugger listentin into the phpstorm and spawn the cli as you do when you run a symfony application.

Answer from Dimitrios Desyllas on Stack Overflow
🌐
Everyone-can-code
everyone-can-code.github.io › Symfony-setting-up-PhpStorm-with-Xdebug-and-Docker-configuration
Symfony setting up PhpStorm with Xdebug, Docker, PhpUnit (configuration)
git clone git@github.com:SanderV1992/Symfony-4.2-skeleton-with-fully-configured-Docker-PHPSTORM-Xdebug-PHPUnit.git my-project
🌐
Medium
medium.com › the-sensiolabs-tech-blog › how-to-use-xdebug-in-docker-phpstorm-76d998ef2534
How to use Xdebug in Docker & PhpStorm | The SensioLabs Tech Blog
June 14, 2022 - You are now able to install Xdebug in Docker by yourself and use it from Storm, a browser or a CLI. Next time you start debugging with var_dump , consider investing a few minutes in installing Xdebug, especially if you have to deal with legacy, ...
Discussions

php - Debug Symfony CLI application with PhpStorm inside Docker container - Stack Overflow
My current setup involve PhpStorm IDE in which I have imported Symfony 3 projects which is basically CLI tool. On the host machine I don't have PHP installed so I'm running the application from Docker container which has PHP and Xdebug installed. More on stackoverflow.com
🌐 stackoverflow.com
XDebug not working with PhpStorm
Hello, I'm trying to use XDebug with PhpStorm on a fresh clone of this repo. I followed all the steps outlined in the documentation. Here are my relevant settings in PhpStorm: I added the follo... More on github.com
🌐 github.com
16
April 11, 2025
How to use xDebug with Symfony?
No need for dbgp proxy Are you on MacOs or Linux? On PHPStorm + MacOs, I've stumbled on a bug where the listening port in settings is 9000,9003 but it doesn't work and should be set to 9003 only. Also have you enabled "listening to remote debug connection" in PHPStorm? More on reddit.com
🌐 r/symfony
21
2
October 25, 2023
XDebug and Docker
Do you use docker Desktop or just the client? More on reddit.com
🌐 r/symfony
12
2
August 31, 2024
🌐
JetBrains
jetbrains.com › help › phpstorm › configuring-xdebug.html
Configure Xdebug | PhpStorm Documentation
In this example, we're modifying /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini providing the mode and client_host Xdebug parameters. Note that the xdebug.client_host value should be replaced with the IP address of the machine where PhpStorm is running, which is accessible from the Docker ...
🌐
GitHub
github.com › dunglas › symfony-docker › blob › main › docs › xdebug.md
symfony-docker/docs/xdebug.md at main · dunglas/symfony-docker
Because it has a significant performance overhead, the step-by-step debugger is disabled by default. It can be enabled by setting the XDEBUG_MODE environment variable to debug. ... You can now use the debugger!
Author   dunglas
🌐
DEV Community
dev.to › jackmiras › xdebug-in-phpstorm-with-docker-2al8
Xdebug in PhpStorm with Docker - DEV Community
November 3, 2023 - Next, a form will open, and there, fill the Name with your Remote Debug configuration; next, check the Filter debug connection by IDE key option and then select the Server previously created; and finally, fill the IDE key (session id) with the same value that got used at the xdebug.idekey directive at our .docker/xdebug.ini. More details are in the illustration below: As a result of the previous steps, the remote debug configuration got finished, and PhpStorm can now start listening for PHP debug connections.
🌐
Brunopaz
brunopaz.dev › blog › docker-phpstorm-and-xdebug-the-definitive-guide
Docker, PHPStorm and Xdebug, The definitive guide | Bruno Paz
September 6, 2018 - In this article I will walk through the process of correctly configuring XDebug with PHPStorm and Docker in a Symfony 4 project.
Find elsewhere
🌐
GitHub
github.com › sskorc › docker-symfony › blob › master › docs › xdebug.md
docker-symfony/docs/xdebug.md at master · sskorc/docker-symfony
This should be in "started" status: Place a breakpoint somewhere in the code and then use the app. You can open it in the browser, call REST API, use Symfony CLI command or run PHPSpec - Xdebug should work for any of the app's endpoints.
Author   sskorc
🌐
Thecodingmachine
thecodingmachine.io › configuring-xdebug-phpstorm-docker
Debugging PHP (web and cli) with Xdebug using Docker and PHPStorm
If you are starting a project, I recommend you to download one of our images here TheCodingMachine Docker PHP images ... app: image: thecodingmachine/php:7.2-v1-apache volumes: - .:/var/www/html environment: PHP_EXTENSION_XDEBUG: 1 · Note: the PHP_EXTENSION_XDEBUG environment variable is specific to the thecodingmachine/php. It automatically configures Xdebug for the container. Keep in mind that PHPStorm opens port 9000 (by default) so Xdebug can connect to it.
🌐
GitHub
github.com › dunglas › symfony-docker › issues › 782
XDebug not working with PhpStorm · Issue #782 · dunglas/symfony-docker
April 11, 2025 - The log in /tmp/xdebug.log shows that indeed XDebug is connecting to PhpStorm but it's another issue, here's part of the log: root@530aecc4a80a:/app# cat /tmp/xdebug.log [281473732758880] Log opened at 2025-04-11 16:01:50.121074 [281473732758880] [Config] WARN: Not setting up control socket with default value due to unavailable 'tsc' clock [281473732758880] [Step Debug] INFO: Connecting to configured address/port: host.docker.internal:9003.
Author   danut007ro
🌐
DEV Community
dev.to › brpaz › docker-phpstorm-and-xdebug-the-definitive-guide-14og
Docker, PHPStorm and Xdebug, The definitive guide - DEV Community
January 2, 2020 - In this article I will walk through the process of correctly configuring XDebug with PHPStorm and Docker in a Symfony 4 project.
🌐
Strangebuzz
strangebuzz.com › home › blog › step by step debugging with xdebug, symfony and phpstorm
Step by step debugging with Xdebug, Symfony and PHPStorm
June 21, 2020 - Here, I use the Symfony binary to serve my application. If you use another type of setup (Apache, Docker...), you'll probably have to make small adjustments to the following instructions. ... I will assume you have a working PHP/Symfony installation. So first let's install Xdebug, it can be done with PECL:
🌐
DEV Community
dev.to › jump24 › turbocharged-php-development-with-xdebug-docker-phpstorm-1n6c
Turbocharged PHP Development with Xdebug, Docker & PHPStorm. - DEV Community
December 30, 2020 - Firstly, the docker volumes – it’s this line that’s going to enable Xdebug: ./xdebug-local.ini:/usr/local/etc/php/conf.d/xdebug-local.ini · The second one was a big gotcha: PHPStorm will need to match the incoming Xdebug server request to the webserver that’s set up in the IDE.
🌐
Reddit
reddit.com › r/symfony › how to use xdebug with symfony?
r/symfony on Reddit: How to use xDebug with Symfony?
October 25, 2023 -

Hello fellow developers! 👋

I'm currently on a quest to set up xDebug with Symfony, and I must admit, it has been quite a challenging journey so far. I've scoured through over 20 blogs, numerous articles, and of course, the official documentation of both Symfony and PhpStorm. Despite my best efforts, success seems to be eluding me. 😞

I'm operating on PHP 8.2 and my project is based on Symfony 6.3. Here’s a rundown of the configurations and steps I’ve taken:

  1. PHP Interpreter: Ensured that Symfony is utilizing the correct PHP interpreter.

  2. xDebug Settings: I’ve stuck with the default settings here.

  3. DBGp Proxy: Configured as needed.

  4. Servers: Set up according to instructions.

  5. php.ini Configuration: Checked and rechecked (using "php --ini") to make sure that Symfony is loading the correct php.ini file located at /etc/php/8.2/cli/php.ini.

  6. Debug Toolbar: Installed and configured.

  7. Chrome Extension: I’ve also installed the xDebug helper extension for Chrome.

  8. Breakpoints: Set at various points in my code to test the debugging process.

My configuration:

php interpreter

making sure symfony uses the correct interpreter

xDebug settings (default)

DBGp

server settings

/etc/php/8.2/cli/php.ini (made sure via "php --ini" this is the loaded .ini)

debug toolbar

xDebug helper chrome extension config

breakpoint

After meticulously going through these steps, I hit a roadblock. When I refresh the page in my browser, expecting the magic of debugging to happen, nothing occurs. No stops at breakpoints, no error messages - just silence.

I’m left here wondering, what could possibly be missing or misconfigured? Is there a hidden step that I’ve overlooked? Why does setting up a debugger for PHP have to be such a complex task?

If any of you kind souls have been through this ordeal and emerged victorious, your wisdom would be greatly appreciated. I’m all ears for any tips, tricks, or insights you might have to share!

Thank you in advance for your time and help! 🙏

So here is the solution:

  1. install php-fpm don't use the php-cli in combination with symfony cli

  2. delete all servers in the PHPStorm settings

  3. set a breakpoint and refresh the page

  4. let it create the server config automatically then just add the "Absolute path to the server" for example /home/username/apps/myapp

  5. ???

  6. profit

🌐
Xdebug
xdebug.org › docs › all_related_content
Xdebug: Documentation » All related content
This video explains in a few minutes how to set-up debugging with PHP and Xdebug running in Docker and PhpStorm. This video explains how to dockerify the Symfony Demo Application, and then setup debugging with Xdebug and VS Code.
🌐
Denisbondar
blog.denisbondar.com › post › phpstorm_docker_xdebug
PhpStorm + Docker + Xdebug - Notes
October 18, 2018 - We cannot provide a description for this page right now
🌐
Partitech
partitech.com › en › technical-blog-article › debug-with-phpstorm-and-symfony-in-a-docker-image
Debug with PhpStorm and Symfony in a Docker Image
January 19, 2023 - For this article you need to have a Symfony app powered by apache/php (or nginx and fpm, it doesn't matter) with a docker-compose.yml file · The first step is to install xdebug and configure your PHP environment.
Address   128 rue La Boétie, 75008, Paris