Xdebug with multiple projects at once.

Hi there, I have a question for you all. I got this working somehow, but still I have an annoying problem connected with it.

This is the context of the problem at hand. I have 2 applications, say:

www.mysite.com
api.mysite.com

Both are in seperate phpstorm projects, and both have their own vhost in apache. The www.mysite.com does API calls to the api.mysite.com using SOAP. I have Xdebug enabled on both, and when I set both my projects to listen it all seems to work fine. Calls are getting a lot slower, but hey, that's allright. I can debug correctly and phpstorm automatically switches between the two to follow the application flow.

The thing now is, let's say I only needed to debug something at the www.mysite.com I do not listen on the api project. Now the problem starts occuring, for every hit that's done on the api project PhpStorm will open a dialog asking me which project I want to start debugging. It gets even worse when I have 3 projects open.

So, finally the question: Is it possible to enforce a certain phpstorm project to only listen to the xdebug calls of one specific URL and ignore the others so I don't keep getting the annoying dialogs?

Thnx.
Marc

24 comments
Comment actions Permalink

Hi there,

Settings | PHP | Debug | Ignore external connections trough unregistered server configurations

See if that option will help here

3
Comment actions Permalink

I tried flipping that option, does not change anything. Does anyone have any idea?

0
Comment actions Permalink

Marc, you may try the following:
1. Set "Max. simultaneous connections" to "1" in "Settings->PHP->Debug"
2. Add your projects which you don't want to debug in "Settings->PHP->Debug->Skipped Paths"
3. Enable option "Ignore ..." which was suggested to you and make sure that unwanted projects are not listed in "Settings->PHP->Servers"

0
Comment actions Permalink

It tried all of that, still not the thing I want.

I have xdebug enabled and started by default in my php.ini.

I want project A to ALWAYS auto accept incoming connections from url B etc. etc ..

It's really f*****ng annoying to have to accept every page hit, js file, css file when starting the debug ..

0
Comment actions Permalink

Marc so you're OK with debugging both projects because initially request was "Is it possible to enforce a certain phpstorm project to only listen to the xdebug calls of one specific URL and ignore the others", aren't you? You just want to get rid off the dialogs, right?

0
Comment actions Permalink

Yeah, the dialogs are really annoying. I'd like a project to accept any incoming request from 1 specific url. So when I enable the debugging on 2 projects, and both urls are called, it should juggle between the projects so I can follow the application flow. If I only enable one in phpstorm it should ignore the other requests.

0
Comment actions Permalink

Any progress with this? I could not agree more with Marc.

0
Comment actions Permalink

Please use PHP Remote Debug configuration where you can provide a specific server as well as a specific IDE key that will be used for listening. 

0
Comment actions Permalink

Done that, still the window shows.

0
Comment actions Permalink

Please try to disable "Listen For Debug Connections".

0
Comment actions Permalink

Im not sure i understand, you want me to "Stop listening for debug connections"? If i do that, nothing happens... But my guess would be thats the expected behaviour.

0
Comment actions Permalink

Heres two screengrabs of the settings

0
Comment actions Permalink

Andriy thats exactly the issue.

0
Comment actions Permalink

Michael, you've configured PHP Remote Debug "Default" configuration but you need to create a real configuration (click "+" and choose PHP Remote Debug"), then Start this configuration and keep "Listen to debug connection" disabled.

0
Comment actions Permalink

Done as adviced, added custom debug settings. Issues remains.

When i dont listen to debug connections, nothing happens. When i do list, popup shows.

0
Comment actions Permalink

The issue is under investigation. I'd suggest to vote/comment/follow WI-22613 since the thread is updated/monitored directly by developers.

0
Comment actions Permalink

This actually works as expected, you just need to click the debugger and NOT listen to incomming connections, and make sure you ahve a NOT default debug setting defined. See this forum topic and this issue: https://youtrack.jetbrains.com/issue/WI-22613#comment=27-1296297 see the screenshots.

 

@staff thank you very much for the very quick repsonses!

0
Comment actions Permalink

This does not work as expected. 

I tried your solution, however, it still asks to select server.

 

Here are my screenshots:

1. Two projects are open at same time -> Sandbox and Payments. Both are configured for different host names (local.sandbox and local.payments)

2. Same configuration in both projects:

 

Payments: (bogus ide key)

Sandbox:


3. In both cases, debugging is started (however, don't understand why I need to start debugging?)




4. When I try to open url in browser: http://local.billing.../, it asks me - which project I want to debug

Question is: WHY?  And how to get rid of that, without disabling debugging for a project.

 

 

0
Comment actions Permalink

The problem is you are still listening to connections, click on the 'Phone icon' to disable listening.

0
Comment actions Permalink

The problem is that I WANT to listen to connections.

I am debugging both projects at same time, some requests I do to project A, while other requests - to project B. 

If I follow your suggestion, then I will need to enable/disable "phone icon" after each request.

0
Comment actions Permalink

Hi Marc,

I would like to enable debugging across several PHP projects, can you let us know how you got it to work in the first place?

I just made a post on this topic:

https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000316564-remote-debug-with-multiple-projects

Thanks,

0

Please sign in to leave a comment.