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

相关推荐
2401_8949155320 分钟前
Geo优化系统源码部署搭建技术——PHP程序开发部署指南
开发语言·php
HH‘HH3 小时前
前端应用的离线暂停更新策略:原理、实现与最佳实践
开发语言·前端·php
xlq223224 小时前
高并发服务器day8(含服务器完整架构)
运维·服务器·php
gongzhxu4 小时前
JetBrains IDEA开发环境搭建
java·ide·intellij-idea
独隅5 小时前
DevEco Code Plan+Build 双 Agent 协同开发实效解析
ide·华为
Yolanda_202221 小时前
在vscode终端中可使用pip,但是cmd终端中找不到命令 pip问题的解决
vscode·python·conda·pip
twcc_come1 天前
安全策略配置实验报告
开发语言·php
ITmaster07311 天前
告别 IDE?Android CLI 来了,开发进入 AI Agent 时代
android·ide·人工智能
weixin_BYSJ19871 天前
springboot3家政平台小程序--附源码00904
java·javascript·spring boot·python·django·flask·php
π同学1 天前
ESP-IDF+vscode开发ESP32 联网篇第一讲——WIFI扫描
vscode·esp32c6·wifi scan