Visual Studio Code PHP Debug does not stop on breakpoints for Docker project

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 19:12:56

Try setting xdebug.remote_connect_back=1 and let me know if that works.

If it does we should probably close this question as a duplicate of the question that I previously answered.

As i know 9000 is the php-fpm port that use by default. So if you use the same port for the xdebug.remote_port=9000 It will not work. You can check that by nginx conf as an example mine cat /etc/nginx/conf.d/site.conf you can check the line fastcgi_pass 127.0.0.1:9000; or run lsof -n -iTCP:9000 | grep LISTEN will show if its utilized. I would suggest you to

  • change it to something not used ex: 10000
  • xdebug.remote_host might wrong, login to the container and try to ping the 172.17.0.2 if it is not working your xdebug.remote_host is wrong. Find the ip of the host machine replace it with the current 172.17.0.2

I run a local linux web server on a VM. And using samba i mapped on a Windows device letter my share.I followed all the suggestions but the breakpoints where not working as supposed. I could only debug adding "stopOnEntry": true" to launch.json, but not on personally added breakpoints, they were all ignored. My problem was the path where my app was running, i fixed like this:

{
        "name": "Listen for XDebug",
        "type": "php",
        "request": "launch",
        "port": 9900,             
        "log": true,
       "stopOnEntry": false,
        "pathMappings": {
             "/var/www/html/booking" : "z:",

          }
 },

    {
        "name": "Launch currently open script",
        "type": "php",
        "request": "launch",
        "program": "${file}",
        "cwd": "${fileDirname}",
        "port": 9900
    }
]

}

This obiouvsly is my linux path -> "/var/www/html/booking" And this is drive mapped letter -> "z:"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!