在移动端开启XDebug调试PHP代码

本文介绍了如何在移动端利用XDebug进行PHP代码的调试,通过在Http请求中添加特定字段激活XDebug,配置php.ini文件,以及在OkHttp和WebView中的实现细节。
摘要由CSDN通过智能技术生成

原理

将Http请求中追加XDEBUG_SESSION字段,激活php的xdebug功能。

php.ini

xdebug.remote_autostart = 1 # 重要
xdebug.remote_enable = On
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = Off
xdebug.profiler_output_name = "d:/work/wamp64/logs/xdebug-profiler.log"
xdebug.profiler_output_dir ="d:/work/wamp64/tmp"
xdebug.show_local_vars=0
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001
;xdebug.remote_log="d:/work/wamp64/logs/xdebug.log"
xdebug.default_enable = "Off"
xdebug.remote_handler = "dbgp"
xdebug.idekey = PHPSTORM # 记住这个名字
xdebug.coverage_enable=0

OkHttp

import android.text.TextUtils;

import java.io.IOException;
import java.net.URLEncoder;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

public class CookieIntercep
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值