PHP comes with a very capable socket programming API. These socket functions include almost everything you would need for socket-based client-server communication over TCP/IP, and can be easily deployed to build simple network applications.
More info here: https://php.net/manual/en/book.sockets.php