1. check whether PHP is for ts or the ts version through phpinfo (); check the ThreadSafety item. this project is to check whether it is thread-safe. if it is for enabled, it should be for ts version, otherwise, the data is stored in the ETS. 2. select the corresponding pthreads version based on PHPtsts. 1. determine whether PHP is ts or the ts version through phpinfo (). check the Thread Safety item to check whether it is Thread security, if it is: enabled, it should be ts in general; otherwise, it will be the ETS.
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!