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

相关推荐
桌面运维家4 小时前
VLAN配置进阶:抑制广播风暴,提升网络效率
开发语言·网络·php
F1FJJ10 小时前
Shield CLI PostgreSQL 插件现已上架 VS Code 扩展市场
网络·vscode·网络协议·postgresql·开源软件
golang学习记12 小时前
VS Code 1.113 发布:Agent 与 Chat 体验全面升级!
vscode·microsoft
luanma15098012 小时前
Laravel 4.x:现代PHP框架的奠基之作
开发语言·php·laravel
Sgf22713 小时前
第15章 网络编程
开发语言·网络·php
Sarapines Programmer14 小时前
【VSCode插件】VSCode 插件 Roo Code 简明指南
ide·vscode·编辑器
一只会跑会跳会发疯的猴子14 小时前
php操作ssl,亲测可用
android·php·ssl
monsion14 小时前
Code Agent 不是编程工具:它是今天最接近通用 Agent 的现成形态
人工智能·vscode·个人开发
千里马学框架15 小时前
aospc/c++的native 模块VScode和Clion
android·开发语言·c++·vscode·安卓framework开发·clion·车载开发
luanma15098016 小时前
Laravel 5.x核心特性与升级指南
php·laravel