I am in the process of connecting a Node.JS server with a PHP application (on the same VPS) and a solution that I have found was to communicate via cURL.
I am thinking of going one step further and instead of have an HTTP server running on a custom port, I will write a Node.js socket server that accepts a custom protocol, and my PHP would connect via raw sockets.
The reason is because I assumed that this is how PHP connects to a MySQL server (obviously via some sort of MySQL protocol).. am I right? Because I can connect to MySQL from a remote PHP application without any problems, so there must be some sort of network communication between the two!?
So my question is, can someone tell me how PHP connects to MySQL? There must be networking somewhere along the line.
EDIT: I know the MySQL runs on port 3306; this has got to be relevant to the PHP MySQL APIs..