远程调试环境配置

目录

一,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

相关推荐
saber_andlibert1 天前
【docker】网络基础和容器编排
网络·docker·php
郝学胜-神的一滴1 天前
Linux信号四要素详解:从理论到实践
linux·服务器·开发语言·网络·c++·程序人生
阿干tkl1 天前
CentOS Stream 8 网络绑定(Bonding)配置方案
linux·网络·centos
深眸财经1 天前
汽水音乐崛起的冷思考:抖音「附属业务」能否自立?
网络
-曾牛1 天前
CSRF跨站请求伪造:原理、利用与防御全解析
前端·网络·web安全·网络安全·渗透测试·csrf·原理解析
孫治AllenSun1 天前
【Doris】运维命令
运维·服务器·网络
sdszoe49221 天前
思科ACL技术基础1
网络·思科acl技术
IT狂人日志1 天前
天翼云电脑:助您办公如虎添翼
网络·电脑
xian_wwq1 天前
【学习笔记】威胁情报
网络·笔记·学习
2345VOR1 天前
【创龙RK3576开发板与电脑直连网络配置指南】
网络·电脑