I have a PHP MVC website (site.com), which calls my PHP API (api.site.com) using a cURL call, and I am having trouble debugging between them.
Both are hosted on the same remote server, in separate phpstorm projects, using one virtual-host file with an "Alias" entry.
My php.ini xdebug entry looks like this:
And my .bashrc contains the following:
What I know so far:
-Hitting the "Debug 'site.com'" button will listen for incoming connections for a given IDE key (e.g. 'PHPSTORM'),
-Whereas hitting the "start listening for php debug connections" button will listen for ALL connections
What I do not know:
-I open two PhpStorm windows (one per project). If I try to hit the "Debug" button in both, I get the error "handler with the same session id is already registered". Am I mean to have different IDE keys? If so, how, because right now the IDE key is set in my php config file, and not on a per-project basis.
-If instead of debugging I "start listening for php debug connections" in both projects, the first call is caught and it debugs correctly. But when the cURL call is made the second project does not debug.
I read the following articles but they did not really help:
The first article would suggest that I need to pass a bunch of GET parameters with every request in order to trigger debugging. This is not an ideal solution for several reasons (maintenance, production).
Is there a "standard" procedure for debugging multiple (but related) projects on a remote server? For example, can I set multiple IDE keys on a single server?
If this is possible I will be able to subdivide my app into many microservices, which will be amazing.