In my last post, I talked about how to configure Xdebug in VSCode with Docker. Now, I would like to share how we can build upon our previous Docker...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for article!
I want to add some notes.
@nuryagdym how are you doing?
Thanks for adding the notes, I really appreciate it!
I just would like to leave it an observation about setting xdebug.client_host=host.docker.internal... Last time I've checked this didn't work for all OS (Linux, Mac, and Windows) while setting the IP works for the three of them.
For anyone else reading this comment, if your OS works by setting the client host this way, I recommend that you do it because it will save you from having to update your IP address from time to time.
Also, could you to share what have you done about the xdebug.mode=profile? Have you removed it to avoid slowness? I'm asking because other people reading the article and comments may run in the same problem.
Once again, thanks for adding the notes.
I am good thank, hope you are well also :).
xdebug.client_host=host.docker.internal does work on my Mac.
I removed profile mode from xdebug.mode. I had a heavy CLI command which runs hours, and profile mode was creating cacheGrind log files which become huge (millions of rows).
Yes! Thank you!
I couldn't get Xdebug 3 working with Docker + WordPress on Mac. It was adding the PHP Remote Debug configuration and using
xdebug.idekey
that made the difference.Thanks!
"Notice that the Port matches the port from our previsouly built docker-compose.yml" <- Which docker-compose.yml?
Is there something like
in there?
Hello @andythedandy, how are you doing?
Thanks for quoting this part of the post, it was, in fact, missing external links pointing to the other two posts that serve as base to this one.
Talking about the PHP > Servers configuration, we are pointing to port 8000 because we are connecting to the service in our docker-compose stack that has PHP ready to go.
As you will notice, this service which is called app gets built based on a Dockerfile, also explained in a previous post.
Both the post where I share how do I usually build my Dockerfile and docker-compose.yaml are now linked in the same session that initially got you confused.
In case you've notice anything else in this post or if you have other questions, feel free to reach me out.
DC
services:
nginx:
container_name: nginx
build:
context: ./_docker/nginx
dockerfile: Dockerfile
ports:
- "8080:80"
volumes:
- ./src:/var/www/html
networks:
- internal
php:
container_name: php-fpm
build:
context: ./_docker/php-fpm
dockerfile: Dockerfile
volumes:
- ./src:/var/www/html
- ./_docker/php-fpm/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
tty: true
networks:
- internal
networks:
internal:
driver: bridge
The problem is that I need to reload the page in the browser every time, otherwise it does not show the debug point.
Hi,
thanks for that tutorial. Sort of got it to run.
However, the moment I tell PHP Storm to listen for debugging connections, any request to my application would run into a timeout.
Only if I tell PHPStorm to listen for debugging connections, the request will be processed, and also only by clicking on "Resume Program" in the Debug window.
Is that intended behavior or is there something wrong with my setup?
My understanding so far was, that program execution should only be interrupted if there are breakpoints set.
Hello @lebru,
I didn't experience this issue, but In case you didn't resolve this issue yet, please mail me at jackmiras@gmail.com with more details and prints and/or videos about the problem… I'll reproduce it as soon as I can.
A definitive tutorial and explanation
thank you, I need your guide