The setup is two separate PHP projects running on the same server using PHP-FPM. Currently they "speak" to each other over JSON by making HTTP requests with cURL.
The issue here is that cURL and web server overhead is a waste of time. After all the other program is right there, in a folder just above the current one. So why go the long way around with cURL and HTTP? The trick is I can't just include a file form the other project because autoloaders clash and make a big mess. For that reason they need separate processes and not share too much.
What I've proposed to solve the issue is to create a Node.js server that listens to a socket that my PHP process can connect to and is able to make requests to PHP-FPM directly using the node-phpfpm module. While this solves the issue, I'm asking myself why is that Node.js proxy needed?
There must be a way to make a new FPM request directly from PHP but I haven't found it.
I know I could also use the CLI executable with exec() but that's not pretty at all. To be more specific, passing request data with exec() is nearly impossible.