http://php.net/manual/ru/book.pthreads.php
Everyone writes that it is very simple, but in fact it turns out a little more complicated.
How to recompile (recompile) php, and then (if I understand correctly) put it into the system. And it turns out you need to remove all php- * similar parts from the system.
Is there a php package ready for installation with pthreads?