PHP Eclipse Xdebug two or more requests at a time

1.2k views Asked by At

I cannot find any info on this anywhere. I have a long running process triggered by a HTTP request, and then another short process triggered by a HTTP request that checks the status of the long running process. Both are called via AJAX. The first by a button click, and the second on a continuous timeout.

If I run the requests one at a time, then they work. The problem is, when running the first process, Eclipse completely ignores the second request (if the first hasn't finished), but I need the second request to be debugged whilst the first request is still being processed

I've even tried running the first process independently of the debugger, and just trying to use the debugger for the second process. However I just cant seem to catch the second process in the debugger like I can the first.

Ideally I'd like to be able to debug 2 or more processes simultaneously.

It appears this can be done using Eclipse and Java. However PHP support is looking pretty thin.

4

There are 4 answers

0
po_taka On

Debug 2 processes simultaneously is pretty hard :)

You can easy debug only 2nd request:

Start listening for debug session in editor. Start process 1 without debug parameter (it should not start debug session). Process 1 should send request with param for debug session start (XDEBUG_SESSION_START=netbeans-xdebug)

e.g.

GET http://localhost/myproject/?XDEBUG_SESSION_START=netbeans-xdebug'

voila :)

This example works for netbeans, for eclipse it should be

XDEBUG_SESSION_START=ECLIPSE_DBGP
0
stenven Dang On

In Preferences->PHP->Debug->Installed Debugger->Xdebug, Click Configure->Changed Accept remote session JIT from any to off.

0
zulus On

Did you enabled multisession on xdebug configuration?

Preferences / PHP / Debug / Installed Debuggers / Xdebug / Configure and select checkbox "Use multisession"

0
Patricio Rossi On

You will need to activate xdebug.remote_autostart = 1 in the xdebug.ini file and also you need to activate the xdebug multisession and remove session Multisession