I have a problem with threads php. I copied files (pthreadVC2.dll in "C:\\wamp\\bin\\php\\php5.4.3" and php_pthreads.dll in "C:\\wamp\\bin\\php\\php5.4.3\\ext") and I added this line (extension=php_pthreads.dll) in php.ini
This is my code:
class Thread1 extends Thread{
public function process($pParams=null){
sleep ($pParams->time);
return "Fin après".$pParams->time ."secondes";
}
}
$manager = _class("thread|threadmanager");
$manager->add("monmodule|thread1",_ppo(array('time'=>2)));
$manager->add("monmodule|thread1",_ppo(array('time'=>3)));
$manager->add("monmodule|thread1",_ppo(array('time'=>1)));
$reponses = $manager->execute();
But I have always this problem:
(Fatal error: Class 'Thread' not found in..)
您是否检查了扩展是否真的通过phpinfo()
加载了?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.