Vscode整合PHP Server 和debug

VsCode 配置PHP Debug 调试代码_vscode php7.4.3 debug-CSDN博客

按着上面的配置差不多

重要的是php.ini

Xdebug

xdebug.remote_autostart =On

zend_extension=D:/phpstudy_pro/Extensions/php/php5.6.9nts/ext/php_xdebug.dll

xdebug.collect_params=1

xdebug.collect_return=1

xdebug.auto_trace=On

xdebug.trace_output_dir=D:/phpstudy_pro/Extensions/php_log/php5.6.9nts.xdebug.trace

xdebug.profiler_enable=On

xdebug.profiler_output_dir=D:/phpstudy_pro/Extensions/php_log/php5.6.9nts.xdebug.profiler

xdebug.remote_enable=On

xdebug.remote_host=localhost

xdebug.remote_port=9000

xdebug.remote_handler=dbgp

然后vscode运行和调试的配置文件

{

// 使用 IntelliSense 了解相关属性。

// 悬停以查看现有属性的描述。

// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387

"version": "0.2.0",

"configurations": [

{

"name": "Listen for Xdebug",

"type": "php",

"request": "launch",

"port": 9000

},

{

"name": "Launch currently open script",

"type": "php",

"request": "launch",

"program": "${file}",

"cwd": "${fileDirname}",

"port": 9000,

"runtimeArgs": [

"-dxdebug.start_with_request=yes"

],

"env": {

"XDEBUG_MODE": "debug,develop",

"XDEBUG_CONFIG": "client_port=${port}"

}

},

{

"name": "Launch Built-in web server",

"type": "php",

"request": "launch",

"runtimeArgs": [

"-dxdebug.mode=debug",

"-dxdebug.start_with_request=yes",

"-S",

"localhost:3000"

],

"program": "",

"cwd": "${workspaceRoot}",

"port": 9000,

"serverReadyAction": {

"pattern": "Development Server \\(http://localhost:(0-9+)\\) started",

"uriFormat": "http://localhost:%s",

"action": "openExternally"

}

}

]

}

先启动调试中的debug

然后在右键PHP Server :Server Project

相关推荐
司悠9 小时前
【解决在vscode里开服务器登录codeX后发消息会一直reconnecting】
服务器·ide·vscode
xyz59911 小时前
Astyle对应.clang-format
vscode
维度攻城狮11 小时前
在Vscode连接的Docker容器中使用codex,并配置DeepSeek模型
vscode·docker·codex
Nayxxu12 小时前
Claude API 生产稳定性设计:超时、降级、备用模型和告警怎么做
开发语言·php
咸鱼翻身小阿橙13 小时前
在VScode使用C#并且调用opencv库
vscode·opencv·c#
Allenliu _Andy13 小时前
2026 最新版|免登录适配国内网络 Claude Code 终端版安装配置教程(Windows)
ide·chatgpt·openai·ai编程·claude code
狗凯之家源码网14 小时前
三角洲行动护航系统源码部署与运营指南
开源·php
CTA量化套保15 小时前
Jupyter Notebook 反复运行天勤策略内存涨:close 与内核习惯
ide·人工智能·python·jupyter
Esaka_Forever21 小时前
PyCharm 社区版无法识别 .db 文件类型
数据库·ide·pycharm
Aaswk21 小时前
Java项目:文件批量处理工具
java·开发语言·vscode·idea