Search code examples
phpdockerdocker-composephpstorm

Debugging with Docker Compose remote interpreter: db container unknown


I am currently trying to debug my tests in PhpStorm with a docker-container as remote interpreter. The problem I am facing is that, though I can connect to the remote interpreter and execute my code on it, the container seems to be unaware of the other containers from the compose file. Unlike normally he is unable to connect to the database, which runs in another container (host=mysql).

Does anybody had the same issue before and found a solution?


Solution

  • Are you setting up your remote interpreter as Docker or Docker Compose? In PhpStorm go to Preferences -> PHP -> CLI Interpreter -> ... and Check if you have Docker Compose or Docker section right under the name of Interpreter. If it's not Docker Compose, add a new Interpreter and make sure to chose Docker Compose for this one