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

相关推荐
Caesar Zou5 小时前
ssh远程连接服务器,vscode不显示claude
服务器·vscode·ssh
大孜然8 小时前
Macao资料生成程序,全新的UI 三端自适应PHP空间
php
JoannaJuanCV8 小时前
vscode debug Transformer源码说明
ide·vscode·transformer·qwen3
炘东5929 小时前
让Pycharm的Terminal(终端)进入创建好的虚拟环境
ide·python·pycharm
挨踢攻城10 小时前
网络安全 | 如何防御勒索软件?
安全·web安全·网络安全·php·厦门微思网络·防疫勒索软件
ZJU_统一阿萨姆10 小时前
Windows系统VSCode配置Rust开发环境(超详细保姆级教程)
windows·vscode·rust
低音钢琴10 小时前
【从零开始构建性能测试体系-08】如何诊断性能瓶颈:从服务器到数据库的全方位分析
服务器·数据库·php
絔宝10 小时前
Eclipse控制台乱码解决方式
java·ide·eclipse
laoma-cloud11 小时前
网络基础综合实验
网络·php
GOATLong11 小时前
MySQL内置函数
android·数据库·c++·vscode·mysql