远程调试环境配置

目录

一,vscode中使用xdebug调试php

二,SSH连接与远程断点调试


一,vscode中使用xdebug调试php

1,在phpstudy中启用xdebug扩展

2,打开php.ini,修改配置

vbnet 复制代码
[Xdebug]
zend_extension=D:/PHP/Extensions/php/php5.6.9nts/ext/php_xdebug.dll
xdebug.collect_params=1
xdebug.collect_return=1
xdebug.auto_trace=Off
xdebug.trace_output_dir=D:/PHP/Extensions/php_log/php5.6.9nts.xdebug.trace
xdebug.profiler_enable=Off
xdebug.profiler_output_dir=D:/PHP/Extensions/php_log/php5.6.9nts.xdebug.profiler
xdebug.remote_enable=Off
xdebug.remote_host=localhost
xdebug.remote_port=9010
xdebug.remote_handler=dbgp

3,下载PHP Debug、PHP Intelephense、PHP Xdebug

4, 修改vscode配置

5, 打开的settings.json中,添加php路径

vbnet 复制代码
"php.debug.executablePath": "D:\\PHP\\Extensions\\php\\php5.6.9nts\\php.exe",
 "php.validate.executablePath": "D:\\PHP\\Extensions\\php\\php5.6.9nts\\php.exe"

6, 配置launch.json

vbnet 复制代码
{
    "configurations": [
        

        {
            "name": "Launch current script in console",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "externalConsole": false,
            "port": 9010
        },
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9010
        }
    
    ]
}

7,调试

二,SSH连接与远程断点调试

1,下载PHP Xdebug

2,在下载的新扩展中输入虚拟主机ip地址

选择第一个,再输入密码即可

3,在远程连接上安装PHP Debug,配置端口

进入/etc/php/5.6.9/fpm/config.d/20-xdebug.ini写入端口

进入php.ini,同样写入上述内容,最后重启php-fpm服务和web服务

4,配置完成后,开始debug

相关推荐
DianSan_ERP3 天前
电商API接口全链路监控:构建坚不可摧的线上运维防线
大数据·运维·网络·人工智能·git·servlet
呉師傅3 天前
火狐浏览器报错配置文件缺失如何解决#操作技巧#
运维·网络·windows·电脑
2501_946205523 天前
晶圆机器人双臂怎么选型?适配2-12寸晶圆的末端效应器有哪些?
服务器·网络·机器人
linux kernel3 天前
第七部分:高级IO
服务器·网络
数字护盾(和中)3 天前
BAS+ATT&CK:企业主动防御的黄金组合
服务器·网络·数据库
~远在太平洋~3 天前
Debian系统如何删除多余的kernel
linux·网络·debian
unfeeling_3 天前
Keepalived实验
linux·服务器·网络
坐吃山猪3 天前
OpenClaw04_Gateway常见问题
网络·gateway·openclaw
上海云盾商务经理杨杨3 天前
2025年重大网络安全事件回顾与趋势分析
网络·安全·web安全
kylezhao20193 天前
C# 的开闭原则(OCP)在工控上位机开发中的具体应用
网络·c#·开闭原则