dongzexi5125 2019-02-26 11:46
浏览 406

Docker Compose - XDebug - VScode调试设置

I have a problem in debugging PHP with VSCode.

Dockerfile EXPOSE port 80

The page I want to debug is really simple:

home.php

<?php

$name = 'AAA';
echo $name; <--- here is the breakpoint

php.ini

xdebug.default_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.remote_enable = 1
xdebug.remote_port = 80
xdebug.idekey = VSCODE

launch.json (XDebug configuration)

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Listen for XDebug",
      "type": "php",
      "request": "launch",
      "port": 9000
    }
  ]
}

Debug console doesn't show any error, but it's not stopped at breakpoint once I load the home-page.

  • 写回答

1条回答 默认 最新

  • dph19153 2019-02-27 14:18
    关注

    Your remote_port directive is wrong.

    That is meant to be the port your debugger will be listening to. Typically, is 9000.

    You can leave it unset and that value will be used (which matches with the configuration you seem to be using on Visual Studio Code.

    评论

报告相同问题?