visual studio code PHP debugging not working

前端 未结 6 794
清歌不尽
清歌不尽 2021-02-02 13:04

I have installed VS Code and the PHP debugger.

I am using xampp.

I tried running the code (2) ways (listen and launch).

6条回答
  •  后悔当初
    2021-02-02 13:39

    Have you checked to make sure the firewall allows Inbound connections on Port 9000? I had this exact problem on one of my development machines. While all other settings were correct I wasn't able to hit the break points. Once I added an exception in the firewall it started working.

    So if this is what the issue is with your setting, you have two options to fix it.

    1. Turn OFF your firewall completely, or at least temporarily while you work on your project.
    2. Add an exception to your Firewall settings:
      • Go to your Windows Control Panel and type "Firewall".
      • Select "Inbound Rules" from the left navigation, then click on "New Rule".
      • Select "Port" then hit "Next".
      • Make sure the "Specific local ports" option is selected and type "9000" for the port number.
      • Select "Allow the connection" then hit "Next".
      • Check "Domain", "Private" and "Public" then hit "Next".
      • Enter a descriptive name like "XDebug Port", then hit "Finish".
      • Restart Visual Studio Code, then try debugging again.

    Assuming that you have the Web Server portion of the configuration setup correctly this should allow you to debug.

    Hope this helps.

提交回复
热议问题