PHP installation of pthreads multi-thread extension tutorial [windows]. 1. check whether PHP is a ts or an ETS version through phpinfo (); check the ThreadSafety item. this project is to check whether it is thread-safe. if it is: enabled, in general, it should be ts version 1. determine whether PHP is ts or ETS through phpinfo (); check the Thread Safety item in it. this project is to check whether it is Thread-safe. if it is: enabled, in general, it should be ts version; otherwise, it will be the ts version.
2. select the corresponding pthreads version based on the PHP ts version
The idea file package, where 0.1.0 indicates the current pthreads version number, 5.4 indicates the php version number, ts indicates the ts version corresponding to php, and vs9 indicates that it is compiled by the Visual Studio 2008 compiler, the last x86 version represents a 32-bit version.
Extract the packages to the pthreadvc2.dlland php_pthreads.dllfiles, put the vc2files in the same directory as php.exe, and put php_pthreads.dll in the extension directory. 1. modify the php. ini file and add extension = php_pthreads.dll.
2. modify the Apache configuration file httpd. conf and add LoadFile X:/PHP5/pthreadVC2.dll.
3. restart the Apache server
IV. test pthreads extension
arg = $arg; } public function run(){ if($this->arg){ printf(Hello %s, $this->arg); } }}$thread = new AsyncOperation(World);if($thread->start()) $thread->join();?>
Run the above code to get "HelloWorld". it indicates that the pthreads extension is successfully installed!
Pipeline uses phpinfo (); to check the Thread Safety item. this project is to check whether it is Thread-safe. if it is: enabled, it should be ts version...