vscode+php+xdebug won't stop at breakpoint 断点不起作用

not stopping on breakpoints

breakpoint not working

原因:

1) php.ini xdebug 端口不配置的情况下,默认是 9000,如果vscode里面改为了其他端口,php.ini里面也要改为同样的端口。

如:

  a) vscode launch.json

"configurations": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9179,
            "stopOnEntry":true,
            "log": true
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9179,
            "stopOnEntry": false,
            "log":true
        }

 php.ini 需要这么设置

[XDebug]
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir ="D:\BtSoft\WebSoft\temp\xdebug\"
xdebug.trace_output_dir ="D:\BtSoft\WebSoft\temp\xdebug\"
xdebug.profiler_output_name = "cache.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_autostart = 1
xdebug.remote_autorestart=1
xdebug.remote_connect_back=1
xdebug.remote_port=9179
xdebug.remote_log = "D:\BtSoft\WebSoft\temp\xdebug\debug.log"
zend_extension=php_xdebug.dll

 

否则断点不起作用

转载于:https://www.cnblogs.com/tyonly/p/vscode_xdebug_breakpoint_not_working.html

你可能感兴趣的:(vscode+php+xdebug won't stop at breakpoint 断点不起作用)