Liunx远程调试

1、Vscode中使用xdebug调试php

 2、工具的下载

 3、debug的配置


1、Vscode中使用xdebug调试php

1,在phpstudy中启用xdebug扩展

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

[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路径 

"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

{
    "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,调试

 2、工具的下载

1、安装remote-SSH

 2、在此输入需要连接的IP地址以及格式正确

 3、debug的配置

在 /var/www/html/ 下建立一个 xx.php 文件,内容为 phpinfo(); 如图:

打开浏览器访问此页面

 

3,在远程连接上安装PHP Debug,配置端口
进入/etc/php/5.6.9/fpm/config.d/20-xdebug.ini写入端口 

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值