当前位置:网站首页>使用宝塔+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
边栏推荐
- The annual transaction volume of the app store is US $1 million, and only 15% commission is paid. Small and medium-sized developers are very contradictory
- 青岛敏捷之旅,来了!
- 2021-09-28
- Mairadb数据库基本操作之数据管理
- 点击添加按钮--出现一个框框(类似于添加学习经历-本科-研究生)
- 跨域CORS的情缘~
- egg中的cors和proxy(づ ̄3 ̄)づ╭~踩坑填坑的过程~ToT~
- 我这位老程序员对时代危险和机遇的一点感悟?
- (十一)vscode代码格式化配置
- WTL 自绘控件库 (CQsCheckComboxBox)
猜你喜欢
随机推荐
SQLyog的基本使用
CPT 104_ TTL 09
Nacos source code startup error report solution
即将毕业的大学生找技术开发工作的焦虑根源
JS Array常见方法
如何在Word中添加漂亮的代码块 | 很全的方法整理和比较
[untitled] kimpei kdboxpro's cool running lantern coexists with beauty and strength
Kanban Quick Start Guide
Data management of basic operation of mairadb database
开源规则引擎——ice:致力于解决灵活繁复的硬编码问题
How to add beautiful code blocks in word | a very complete method to sort out and compare
Three 之 three.js (webgl)旋转属性函数的简单整理,以及基于此实现绕轴旋转的简单案例
Musk and twitter storm drama
2021-10-25
Master-slave replication of MariaDB database
To understand Devops, you must read these ten books!
What are the most popular recruitment technical skills in 2022? You can't think of it
Simple application of parallel search set (red alarm)
Interpretation of common SQL statements
Collaboration future object and concurrent futures

![Laravel [view]](/img/39/71db98d8832d9419bcc1097594d1b6.png)
![[untitled]](/img/49/770888f4f351f42af0e01c3a15ddfa.png)






