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

相关推荐
BingoGo2 小时前
PHP 15 个高效开发的小技巧
后端·php
JaguarJack4 小时前
PHP 15 个高效开发的小技巧
后端·php
HealthScience4 小时前
codex、WSL中使用(cursor)使用chrome-devtools-mcp最佳实践
vscode
小蕾Java15 小时前
PyCharm 软件使用各种问题 ,解决教程
ide·python·pycharm
pu_taoc16 小时前
深入剖析:基于epoll与主从Reactor模型的高性能服务器设计与实现
服务器·c语言·c++·vscode
魔众18 小时前
ModStartCMS v9.7.0 组件升级优化,模块升级提醒,访问明细导出
php·cms
周杰伦_Jay21 小时前
【Git操作详解】Git进行版本控制与管理,包括分支,提交,合并,标签、远程仓库查看
大数据·ide·git·科技·分类·github
一人の梅雨21 小时前
京东商品详情深度解析:从接口调用到商业价值挖掘的技术实现
服务器·数据库·php
帅帅梓21 小时前
docker网络
网络·docker·php
小二·1 天前
mac下解压jar包
ide·python·pycharm