当前位置:网站首页>使用宝塔+xdebug+vscode远程调试代码
使用宝塔+xdebug+vscode远程调试代码
2022-04-23 05:23:00 【互联网行者】
背景
php运行程序在远程服务器上,想在本地调试远程代码。
vscode配置
1、远程打开项目代码,需要安装remote development进行远程连接,连接后输入远程项目代码路径就可以连接上。
2、php调试需要安装phpdebug插件
3、在项目代码launch.json配置调试信息
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 0,
"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:0"
],
"program": "",
"cwd": "${workspaceRoot}",
"port": 9003,
"serverReadyAction": {
"pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",
"uriFormat": "http://localhost:%s",
"action": "openExternally"
}
}
]
}
### 宝塔配置
在已经安装好的php版本上安装扩展插件xdebug,在安装目录php目录修改php.ini
[XDebug]
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_host=localhost
xdebug.client_port=9003
最好就可以在vscode设置断点进行调试了。
版权声明
本文为[互联网行者]所创,转载请带上原文链接,感谢
https://blog.csdn.net/learner198461/article/details/124269514
边栏推荐
- Interesting prime number problem hdu5750
- 了解 DevOps,必读这十本书!
- Laravel database
- 4 个最常见的自动化测试挑战及应对措施
- MFC implementation resources are implemented separately by DLL
- MySQL foreign key constraint
- Requirements for SQL server to retrieve SQL and user information
- Flip coin (Blue Bridge Cup)
- 即将毕业的大学生找技术开发工作的焦虑根源
- Swing display time (click once to display once)
猜你喜欢
无线网怎么用手机验证码登录解决方案
SQLyog的基本使用
2021 年 25 大 DevOps 工具(下)
Three of three JS (webgl) is simple to draw lines / arcs according to points (based on linegeometry / line2 / linematerial, draw two arc segments based on the center of the circle)
Blender programmed terrain production
狼叔来找翻译人员了--plato--持续翻译中.....
Simple application of parallel search set (red alarm)
青岛敏捷之旅,来了!
Laravel database
2022年最热门的招聘技术技能是什么,您绝对想不到
随机推荐
Cloud computing and cloud native architecture design of openshift
C language hash dictionary and notes
C#测试调用PaddleSharp模块识别图片文字
Semi synchronous replication of MariaDB
Swing display time (click once to display once)
Asynchronous iterator & asynchronous generator & asynchronous context manager
Musk and twitter storm drama
Where, on when MySQL external connection is used
双击.jar包无法运行解决方法
青岛敏捷之旅,来了!
The introduction of lean management needs to achieve these nine points in advance
Devops life cycle, all you want to know is here!
What are the reasons for the failure of digital transformation?
Qingdao agile tour, coming!
Three 之 three.js (webgl)模型的删除/场景的清空/内存的释放 的简单整理
(十一)vscode代码格式化配置
Study notes: unity customsrp-10-point and spot shadows
跨域CORS的情缘~
SQLyog的基本使用
史上最强egg框架的error处理机制