致命错误:未捕获错误:类';workerThread';(PHP线程)

致命错误:未捕获错误:类';workerThread';(PHP线程),php,Php,我不熟悉PHP和Xampp。我在使用pthreads时遇到问题 我得到的错误是: Fatal error: Uncaught Error: Class 'workerThread' not found 我的代码是 class workerThread extends Thread { public function __construct($i){ $this->i=$i; } public function run(){ while(true){ echo $this-

我不熟悉PHP和Xampp。我在使用pthreads时遇到问题

我得到的错误是:

Fatal error: Uncaught Error: Class 'workerThread' not found
我的代码是

class workerThread extends Thread {
public function __construct($i){
  $this->i=$i;
}

public function run(){
  while(true){
   echo $this->i;
   sleep(1);
  }
}
}


function run() {
    global $profilesCount, $profilesNames;
    for ($i = 2; $i < $profilesCount+2; $i++) {
$workers[$i]=new workerThread($i);
$workers[$i]->start();
        }
}
类workerThread扩展线程{
公共功能构造($i){
$this->i=$i;
}
公共功能运行(){
while(true){
echo$this->i;
睡眠(1);
}
}
}
函数运行(){
全球$profilescont,$profilesNames;
对于($i=2;$i<$profilescont+2;$i++){
$workers[$i]=新workerThread($i);
$workers[$i]->start();
}
}
  • PHP版本是
    7.0.6
  • pthreads版本是
    3.1.6
  • PHP扩展构建是API20151012,TS,VC14
  • 我尝试了32位和64位pthreads版本
  • 我将
    php\u pthreads.dll
    复制到
    C:\xampp\php\ext\
  • 我将
    pthreadVC2.dll
    复制到
    C:\xampp\php\
    C:\xampp\apache\bin
    C:\windows\system32
  • Apache不是从
    C:\xampp\php\php.ini
    中添加的
    extension=php\pthreads.dll
    开始的,所以我用
    extension=php\pthreads.dll
    将文件复制到
    C:\xampp\php\php cli.ini
有什么想法吗?我感谢你的帮助