欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2023-11-19 19:31:52
not stopping on breakpoints breakpoint not working 原因: 1) php.ini xdebug 端口不配置的情况下,默认是 9000,如果vscode里面改为了其他端口,php.ini里面也要改为同样的端口。 如: a) vscode launch. ......

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

 

否则断点不起作用