[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"app-article-1":3,"article-surround-1":216},{"article":4,"markdown":19},{"id":5,"category_id":5,"title":6,"author":7,"image":8,"describe":9,"views":10,"sort":11,"status":5,"is_link":12,"link_url":13,"is_hot":12,"created_by":5,"updated_by":14,"create_time":15,"update_time":16,"username":17,"avatar":18},1,"PHP 开发者必备：深入理解与使用 Xdebug 断点调试","saithink","https://image.saithink.top/storage/20260410/a5c069dca6e2f1be38c21bec1e97f39035d38209.jpg","详细介绍PHP在webman下如何使用Xdebug进行调试",1734,100,2,"",123,"2024-06-02 22:55:25","2026-11-19 11:02:29","admin","https://image.saithink.top/storage/20260410/7971881d7e10a122e0f51ea188571dbe29d82229.jpg",{"body":20,"data":210,"toc":211},{"type":21,"children":22},"root",[23,32,60,71,77,82,91,98,103,108,115,120,127,132,139,144,151,162,167,174,179,186,191,198,203],{"type":24,"tag":25,"props":26,"children":28},"element","h2",{"id":27},"一-为什么要使用-xdebug",[29],{"type":30,"value":31},"text","一、 为什么要使用 Xdebug？",{"type":24,"tag":33,"props":34,"children":35},"p",{},[36,38,44,46,51,53,58],{"type":30,"value":37},"    很多 PHP 开发者习惯使用 ",{"type":24,"tag":39,"props":40,"children":41},"code",{},[42],{"type":30,"value":43},"echo",{"type":30,"value":45},"、",{"type":24,"tag":39,"props":47,"children":48},{},[49],{"type":30,"value":50},"print_r",{"type":30,"value":52}," 或 ",{"type":24,"tag":39,"props":54,"children":55},{},[56],{"type":30,"value":57},"var_dump",{"type":30,"value":59}," 来调试代码。虽然简单，但在处理逻辑复杂的循环、深层嵌套的对象或异步请求时，这种方法效率极低。",{"type":24,"tag":33,"props":61,"children":62},{},[63,69],{"type":24,"tag":64,"props":65,"children":66},"strong",{},[67],{"type":30,"value":68},"Xdebug",{"type":30,"value":70}," 的出现将调试从“猜谜游戏”变成了“手术刀式的精准观察”。",{"type":24,"tag":25,"props":72,"children":74},{"id":73},"二如何安装xdebug调试工具",[75],{"type":30,"value":76},"二、如何安装Xdebug调试工具",{"type":24,"tag":33,"props":78,"children":79},{},[80],{"type":30,"value":81},"1、在php里面开启Xdebug扩展，使用的是【FlyEnv】开发环境管理器",{"type":24,"tag":33,"props":83,"children":84},{},[85],{"type":24,"tag":86,"props":87,"children":90},"img",{"src":88,"alt":89,"dataHref":88,"style":13},"https://image.saithink.top/storage/20260410/3ede1ad26168549f3e7e129d263595fc665dc28d.png","image.png",[],{"type":24,"tag":33,"props":92,"children":93},{},[94],{"type":24,"tag":86,"props":95,"children":97},{"src":96,"alt":89,"dataHref":96,"style":13},"https://image.saithink.top/storage/20260410/86fb7641d6d058828a697b1e83dec9ac9e4fbf11.png",[],{"type":24,"tag":33,"props":99,"children":100},{},[101],{"type":30,"value":102},"2、在VSCODE 里面安装扩展工具，并且配置相关命令",{"type":24,"tag":33,"props":104,"children":105},{},[106],{"type":30,"value":107},"在vscode插件市场里面找到 php debug 这个插件并进行安装",{"type":24,"tag":33,"props":109,"children":110},{},[111],{"type":24,"tag":86,"props":112,"children":114},{"src":113,"alt":89,"dataHref":113,"style":13},"https://image.saithink.top/storage/20260410/8c672c740904e03ba14269a54b17b1a6047ad9dd.png",[],{"type":24,"tag":33,"props":116,"children":117},{},[118],{"type":30,"value":119},"配置php路径",{"type":24,"tag":33,"props":121,"children":122},{},[123],{"type":24,"tag":86,"props":124,"children":126},{"src":125,"alt":89,"dataHref":125,"style":13},"https://image.saithink.top/storage/20260410/dc37c2a9677a69348c72374a4c1888821d31bb32.png",[],{"type":24,"tag":33,"props":128,"children":129},{},[130],{"type":30,"value":131},"在settings.json里面配置php的运行路径，包含exe文件",{"type":24,"tag":33,"props":133,"children":134},{},[135],{"type":24,"tag":86,"props":136,"children":138},{"src":137,"alt":89,"dataHref":137,"style":13},"https://image.saithink.top/storage/20260410/95e19a5e12c61527058bcfa251cf3125e2771251.png",[],{"type":24,"tag":33,"props":140,"children":141},{},[142],{"type":30,"value":143},"在项目根目录的.vscode里面，加入lanuch.json，配置如下",{"type":24,"tag":33,"props":145,"children":146},{},[147],{"type":24,"tag":86,"props":148,"children":150},{"src":149,"alt":89,"dataHref":149,"style":13},"https://image.saithink.top/storage/20260410/5c97683b18f50762d8a378527de87e19c8d17a51.png",[],{"type":24,"tag":152,"props":153,"children":154},"pre",{},[155],{"type":24,"tag":39,"props":156,"children":159},{"className":157},[158],"language-javascript",[160],{"type":30,"value":161},"{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"Listen for Xdebug\",\n            \"type\": \"php\",\n            \"request\": \"launch\",\n            \"port\": 9003,\n            \"stopOnEntry\": false\n        }\n    ]\n}",{"type":24,"tag":33,"props":163,"children":164},{},[165],{"type":30,"value":166},"3、启动调试",{"type":24,"tag":33,"props":168,"children":169},{},[170],{"type":24,"tag":86,"props":171,"children":173},{"src":172,"alt":89,"dataHref":172,"style":13},"https://image.saithink.top/storage/20260410/f896163e9d2c94b48c1ce4e9a759b56911b9e794.png",[],{"type":24,"tag":33,"props":175,"children":176},{},[177],{"type":30,"value":178},"启动webman",{"type":24,"tag":33,"props":180,"children":181},{},[182],{"type":24,"tag":86,"props":183,"children":185},{"src":184,"alt":89,"dataHref":184,"style":13},"https://image.saithink.top/storage/20260410/73f3d4e98c6d2c3acbc054378a6b822cb2624bdf.png",[],{"type":24,"tag":33,"props":187,"children":188},{},[189],{"type":30,"value":190},"浏览器访问这个接口",{"type":24,"tag":33,"props":192,"children":193},{},[194],{"type":24,"tag":86,"props":195,"children":197},{"src":196,"alt":89,"dataHref":196,"style":13},"https://image.saithink.top/storage/20260410/ffb709d74b09d9cef2239a253b702455c3c58cd1.png",[],{"type":24,"tag":33,"props":199,"children":200},{},[201],{"type":30,"value":202},"程序进入了调试",{"type":24,"tag":33,"props":204,"children":205},{},[206],{"type":24,"tag":86,"props":207,"children":209},{"src":208,"alt":89,"dataHref":208,"style":13},"https://image.saithink.top/storage/20260410/2be5ab24c41e70694ad54ee56205fb6ab07c77fd.png",[],{},{"title":13,"searchDepth":212,"depth":12,"links":213},6,[214,215],{"id":27,"depth":12,"text":31},{"id":73,"depth":12,"text":76},{"code":217,"message":218,"data":219},200,"success",{"prev":220,"next":221},null,{"id":12,"title":222},"FlyEnv-PHP本地开发工具箱"]