Answer the question
In order to leave comments, you need to log in
How to set up Debug mode if the sources are in Docker?
Already in despair, yesterday I sat all day, today for a couple of hours, I'm marking time, I've climbed a bunch of forums, but I can't stand on the break.
This is how my compose file looks like:
version: "2"
services:
db:
image: mysql:5.6
environment:
MYSQL_ROOT_PASSWORD: "***"
MYSQL_DATABASE: "***"
ports:
- "3306:3306"
web:
image: webdevops/php-nginx-dev:ubuntu-15.10
expose:
- "9000"
- "9001"
ports:
- "8080:80"
- "8443:443"
links:
- db
volumes:
- /Users/evgeny/Projects/php_docker_test/:/app
xdebug.remote_host=dockerhost
xdebug.idekey=PHPSTORM
xdebug.remote_port=9001
xdebug.remote_connect_back=0
xdebug.remote_autostart=0
xdebug.remote_enable=1
xdebug.profiler_enable=0
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
Answer the question
In order to leave comments, you need to log in
From the config in my mind I can see badly what's wrong .... I can advise how to debug:
1. Check in all the right directions using telnet - does the connection open.
2. "php5-fpm -i" and "php5-fpm -m" inside docker (if fpm is there) to see if xdebug and settings really cling. Well, either phpinfo();...
3. look at netstat -ant inside the docker and outside - to understand what is happening with the connection, whether it opens and where it is lost
4. in extreme cases, tcpdump on the host
and here ( https:// xdebug.org/docs/all_settings ) is about xdebug.remote_connect_back , maybe it will give you ideas. And in my opinion, the docker had ready-made images with fpm and configured xdebug under phpstorm
You have a port specified in your Xdebug config 9001
.
And in the container, this port is exposed through the expose
.
expose:
- "9000"
- "9001"
docker-compose.yml
not visible, which means it cannot see Xdebug on the port you feed it. 9001
to ports:
. Host: localhost
for Xdebug (now you have some kind of left IP there).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question