The project needs to use multi-threading, found that PHP installed Pthreads can support multi-threading, so Google down. Probably the installation content is as follows.
Select the corresponding pthreads version according to PHP version ts\nts
Download pthreads: http://windows.php.net/downloads/pecl/releases/pthreads/2.0.9/
I PHP version is 5.4.17, so download the Php_pthreads-0.1.0-5.4-ts-vc9-x86.zip file package, where 0.1.0 is represented as the current pthreads version number, 5.4 is the PHP version number (this need to pay special attention, I have not succeeded is bad here), TS is to judge PHP corresponding TS, NTS version, VS9 represents the visual Studio compiler compiler compiled, The last x86 represents a 32-bit version (64-bit systems can also be used because there is no 64-bit at all).
Installing the pthreads Extension
When the file is downloaded, only 2 files are needed. pthreadVC2.dll and php_pthreads.dll ;
1, modify the php.ini file add Extension=php_pthreads.dll (here need to explain the next php.ini in Apache and PHP have a copy, suggestions are added)
2, put pthreadVC2.dll file to php.exe sibling directory, put php_pthreads.dll In the extensions directory .
Another copy of the PthreadVC2.dll is placed in the Apache/bin directory.
3, restart the wampserver.
Test pthreads Extension
arg = $arg; } Public Function Run () { if ($this->arg) { printf ("Hello%s\n", $this->arg),}} } $thread = new AsyncOperation ("World"); if ($thread->start ())
run the above code to get "HelloWorld", it means the installation pthreads expansion success!
The above describes the Wampserver installation pthreads multithreading extension Tutorial, including the aspects of the content, I hope that the PHP tutorial interested in a friend to help.