multithreading - PHP pthreads: Fatal error: Class 'Thread' not found -


i use php5.5 on webserver. want use pthreads. here's php config: http://dd19010.kasserver.com/infophp.php55

after implementing code.....

 <?php  class asyncoperation extends thread {     public function __construct($threadid)     {         $this->threadid = $threadid;     }      public function run()     {         printf("t %s: sleeping 3sec\n", $this->threadid);         sleep(3);         printf("t %s: hello world\n", $this->threadid);     } }  $start = microtime(true); ($i = 1; $i <= 5; $i++) {     $t[$i] = new asyncoperation($i);     $t[$i]->start(); } echo microtime(true) - $start . "\n"; echo "end\n";  ?> 

... problem error: fatal error: class 'thread' not found in. have include include_once or similar make work? have do??

your phpinfo shows have php thread safety disabled. need install version of php thread safe use pthreads. may or may not fix current issue though.

you may need copy pthreadsvc2.dll bin directory of web service well.

/etc/php55/fpm/ 

you're looking folder php.ini in it.

make sure php.ini file has line added:

extension=php_pthreads.dll 

Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -