PHP 真正的多线程 pthreads

WBOY
Release: 2016-06-23 13:29:25
Original
1198 people have browsed it

安装

pthreads 仅支持php5.3以上的线程安全版本。通过phpinfo()方法查看

1 下载地址 http://windows.php.net/downloads/pecl/releases/pthreads/ 

   根据具体PHP安装环境选择, 我选的是:

php_pthreads-2.0.9-5.6-ts-vc11-x64.zip
Copy after login

其中 2.0.9 是pthreads版本号, 5.6 是php版本号, ts代表线程安全版本(与apache搭配),vc11是编译器VC版本, x64代表目标操作系统64bit的


2 复制php_pthreads.dll 到目录 bin\php\ext\

复制pthreadVC2.dll到php安装根目录下

复制pthreadVC2.dll到system32目录下

打开php.ini 添加扩展extension=php_pthreads.dll

最后重启apache

3pthreads例子 http://docs.php.net/manual/en/book.pthreads.php


 

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template