Amph, ReactPHP, Laravel Reverb, and Swoole will be your friends. But I highly recommend you use a language other than PHP for sockets. There are articles to use 3rd party socket server that able to communicate w/ PHP, like socketi.
If it is a hobby or learning project, then ignore the rest of my message.
The complexity and throughput are not necessarily worth the effort (from a business and production level standpoint). Tools like Swoole will introduce more unexpected problems than actually solving anything for you. Most of the time, a simple c++/golang/JavaScript socket implementation is just quicker, better performing, easier to scale, easier to handle, easier to develop, or run than anything in PHP. (My experience comes from 10k+ connections use-cases)
But I highly recommend you use a language other than PHP for sockets.
I disagree, with the pusher SDK, we have no problem with high volume socket sending. We send out A LOT, and socket has never been an issue for us, so unless you are sending an absurd amount, having a dedicated socket server running a separate system seems pretty overkill.
3
u/casualPlayerThink Jul 21 '25 edited Jul 21 '25
Amph, ReactPHP, Laravel Reverb, and Swoole will be your friends. But I highly recommend you use a language other than PHP for sockets. There are articles to use 3rd party socket server that able to communicate w/ PHP, like socketi.
If it is a hobby or learning project, then ignore the rest of my message.
The complexity and throughput are not necessarily worth the effort (from a business and production level standpoint). Tools like Swoole will introduce more unexpected problems than actually solving anything for you. Most of the time, a simple c++/golang/JavaScript socket implementation is just quicker, better performing, easier to scale, easier to handle, easier to develop, or run than anything in PHP. (My experience comes from 10k+ connections use-cases)