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

Source: Internet
Author: User

1. Check whether PHP is a ts version or a ts version through phpinfo (); check the Thread Safety item. This project is to check whether it is Thread-safe. If it is: enabled, it should generally be a ts version, otherwise, the data is stored in 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!

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.