sockets. meaning TCP, UDP and most preferably Unix sockets. or if you want supper fast something implementing IPC. but dunno how you're gonna make IPC available in PHP. then, to make things more simple, implement RPC on both ends. However, implementing RPC in PHP is going to be an issue since PHP is stateless. The most you can do is expose an API and do HTTP requests on that API. Either that or resort to CLI and run PHP scripts directly via the system() function.
Either way. All of it is possible. But the possibility of you implementing it is not very likely. No disrespect. Just a factual opinion.