The best solution for self-hosting / installing PHP WebSocket right now is Ratchet .
However, as pointed out by @HartleySan, you are unlikely to be able to use the WebSocket solution in general terms due to the requirement of persistent connections. This is especially true for generic PHP solutions that allocate a large amount of resources for each request. Perhaps Ratchet got around this, I don't know.
IMHO the best solution for PHP is to use a hosted service such as Pusher , which I work for. There are other real-time web hosting solutions . This means that you unload persistent connections to the hosted service and you can use your PHP package in the usual way.
Related: OpenShift, PaaS, wrote an article in which WebSockets problems . This helps explain the problems that other hosting providers have when supporting WebSockets.
OpenShift has WebSocket support in preview, so you can try them. But this is obviously a problem if you have already paid for your shared hosting. As above, I recommend the hosted service as the best solution.
source share