PHP Eclipse Xdebug two or more requests at a time
Asked Answered
S

4

18

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.

Slipcover answered 2/12, 2013 at 10:26 Comment(1)
possible duplicate of How to debug multiple sessions in PHP?Ikey
E
1

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

Erhard answered 7/5, 2015 at 19:18 Comment(0)
G
0

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
Granvillegranvillebarker answered 11/12, 2013 at 11:56 Comment(0)
M
0

Did you enabled multisession on xdebug configuration?

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

Medawar answered 1/11, 2014 at 11:26 Comment(0)
A
0

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

Arachne answered 23/7, 2018 at 1:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.