I have a need for this.
To debug the PHP program when the Android app launches a request to the server.
Break the target down, about the following steps
debugging PHP using Eclipse+xdebug, while XDEBUG triggering breakpoints requires the Get method to pass a parameter or set a cookie, I use a cookie method (I think this method is better)
That is, to find a way to get the app to launch a request with cookie information, because app development I am not familiar with, so can only think of other ways, my approach is to hook to the request, and then add the cookie value
Just fine, fiddler. In addition to the ability to crawl HTTP packets, he can modify requests and responses, and I need to modify the request.
There are two ways to modify a request using Fiddler, one is the next breakpoint, then the request header is modified, and the second is to write the script. I'm using the second method.
Add the Onbeforerequest method in the Fiddler script file
if (Osession.hostnameis ("192.168.1.7")) {
OSESSION.OREQUEST.HEADERS.ADD ("Cookie", "XDEBUG_SESSION=ECLIPSE_DBGP");
}
The meaning of this piece of code is
If the requested destination address is a picture of the 192.168.1.7 host, add a cookie, the key is Xdebug_session, and the value is ECLIPSE_DBGP, which is the cookie information I need when I use eclipse to trigger a power outage of PHP, so far, And my needs are fulfilled.
PS: If you debug PHP with Eclipse with Firefox, you can use a plugin called the easiest xdebug.
Reference: Http://www.cnblogs.com/tankxiao/archive/2012/04/25/2349049.html#ScriptEditCookie
Http://xdebug.org/docs/remote
Http://docs.telerik.com/fiddler/KnowledgeBase/FiddlerScript/ModifyRequestOrResponse
Use Fiddler to grab Android app packets and debug PHP programs