Add "LoadFile D:/xampp/php/pthreadVC2.dll" to "httpd.conf"
Restart Apache
4. Test
Official test code:
<?php
class AsyncOperation extends Thread {
public function __construct($arg){
$this->arg = $arg;
}
public function run(){
if($this->arg){
printf("Hello %s\n", $this->arg);
}
}
}
$thread = new AsyncOperation("World");
if($thread->start())
$thread->join();
?>
If it has error, you can use the following command to check it out.
D:\xampp\php>php -m
You can make sure if the pthreads module have been loaded.
1. Check the runtime enviroment
The php of xampp is 32-bit by default.
It determines the location of "pthreadVC2.dll".
2. Download the file
File url : http://windows.php.net/downloads/pecl/releases/pthreads/
Download php_pthreads-2.0.9-5.6-ts-vc11-x86.zip according to the above version.
3. Install
4. Test
Official test code:
If it has error, you can use the following command to check it out.
You can make sure if the pthreads module have been loaded.