Xdebug not working
I followed Mark's video to configure Xdebug. When I load the pages, not getting any breakpoints configured. Can someone help? I can provide what my configs are based on what you may need to troubleshoot.
I had to change the port to 9300 (for xdebug 3) then it worked.
I had to change the port to 9300 (for xdebug 3) then it worked.
This port 9300 is the port for elasticsearch. Could you check which port you changed. I have debug issue as well.
This article goes into detail on a fix: https://matthewsetter.com/setup-step-debugging-php-xdebug3-docker/
In short, run bin/bash to get into the php-fpm container. Then go to /usr/local/etc/php/conf.d and edit the docker-php-ext-xdebug.ini file to match this:
zend_extension=xdebug
[xdebug]
xdebug.mode=develop,debug
xdebug.client_host=host.docker.internal
xdebug.start_with_request=yes
Save that file, then exit out of the bash terminal to your host machine. Run bin/restart to restart the containers. That should get you going.
I had to change the port to 9300 (for xdebug 3) then it worked. Try to change the port to 9003 in PhpStorm Xdebug config section => Preferences | Languages & Frameworks | PHP | Debug (old value was 9001)
You shouldn't need to change any config settings within the container or ini file to get Xdebug working. The culprit here was most likely this last comment, where PhpStorm was listening on the wrong port.
@markshust That is wrong. On linux it definitely doesn't work out of the box. bin/xdebug status shows enabled.
I did this:
- Add
- ./src/docker-php-ext-xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.inito the
services:
app:
volumes: &appvolumes
section of docker-compose.dev.yml
- Create a ./src/docker-php-ext-xdebug.ini with
[xdebug]
xdebug.mode=develop,debug
xdebug.client_host=host.docker.internal
xdebug.start_with_request=yes
bin/restart- Throw a breakpoint into your IDE and it should work now.