Hi everyone!!
I am developing a concurrent websocket server in PHP. I prefer to implement it using pthreads rather than using fork to create new processes, because the server is supposed to handle thousands of connections, and threads are lighter than processes.
But when I execute this code:
<?php
class My extends Thread {
public function run() {
/** ... **/
}
}
$my = new My();
var_dump($my->start());
?>
I get this error:
PHP Fatal error: Class 'Thread' not found in /home/user/htdocs/example/server.php on line 3
Why?? How can I get pthreads working in PHP??
By the way, do you have another suggestions to implement the concurrent server??
I am using Ubuntu 12.04 64bits
Thank you very much!