PHP installation of pthreads multi-thread extension tutorial [windows] _ PHP Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.