Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XDebug session in PhpStorm stuck on curl_exec call

I have the following simplified API:

http://localhost/app/apiA
http://localhost/app/apiB

where apiA does some processing and then performs these simple operations so that apiA calls apiB:

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, site_url('apiB'));
//various other options
$response = curl_exec($curl);

Now I put a breakpoint in PhpStorm right on the curl_exec call in apiA and another right on the first line of the apiB method. What happens is that, first of all, XDebug is stuck on the curl_exec call and will remain there indefinitely; however if I press Break, stopping the interpreter, XDebug breaks but activates my breakpoint in apiB!

I'd like it to perform the call to curl_exec and hit the breakpoint in apiB and then come back to the first breakpoint after it's completed. Is there any way to configure XDebug and/or PhpStorm to do this?

like image 203
SolarBear Avatar asked Aug 25 '15 19:08

SolarBear


1 Answers

This is very simple to do in PhpStorm, simply go to Settings -> PHP -> Debug and in the External Connections section increase the value of the Max simultaneous connections to the number you require - in my case, 2 was enough.

Screenshot of settings

like image 149
SolarBear Avatar answered Sep 22 '22 10:09

SolarBear