vscode调试php进不了断点,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

否则断点不起作用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值