安装php扩展pthreads实现PHP多线程 原创qw871122015-04-16 17:01评论(0)948人阅读 下面介绍两种编译方式: 1、在已有的PHP上编译pthreads扩展 注:需
来源:互联网 发布:网络上黄泉 漫画 编辑:程序博客网 时间:2024/06/14 05:35
安装php扩展pthreads实现PHP多线程
下面介绍两种编译方式:
1、在已有的PHP上编译pthreads扩展
注:需要动态加载pthreads模块,之前在编译php时必须启用--enable-maintainer-zts;否则需要重新编译PHP。
pthreads源码包下载地址:wget http://pecl.php.net/get/pthreads-3.1.6.tgz
tar xf pthreads-3.1.6.tgz
cd pthreads-3.1.6
phpize
./configure --enable-pthreads --with-php-config=/usr/local/php/bin/php-config
make && make install
2、重新编译PHP,加载pthreads
tar xf php-5.5.8.tar.gz
tar xf pthreads-3.1.6.tgz
mv pthreads-3.1.6.tgz php-5.5.8/ext/pthreads 将pthreads解压,移动到php/ext/下,并改名为pthreads;
来到php源码目录
./buildconf --force
./configure --help | grep thread
是否能看到--enable-threads,如果没有则执行:
rm -rf aclocal.m4
rm -rf autom4te.cache/
./buildconf --force
初始化编译配置:
./configure --prefix=/usr/local/php --enable-opcache --with-config-file-path=/etc --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-fpm --enable-pthreads --enable-fastcgi --enable-static --enable-inline-optimization --enable-sockets --enable-wddx --enable-zip --enable-calendar --enable-bcmath --enable-soap --with-zlib --with-xmlrpc --enable-mbstring --without-sqlite --with-curl --enable-ftp --with-mcrypt --with-freetype-dir=/usr/local/freetype.2.1.10 --with-jpeg-dir=/usr/local/jpeg.6 --with-png-dir=/usr/local/libpng.1.2.50 --disable-ipv6 --disable-debug --with-openssl --enable-maintainer-zts --disable-safe-mode --disable-fileinfo
make && make install
cp php.ini-production /etc/php.ini
install -v -m755 ./php-5.5.7/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
启动php-fpm
/etc/init.d/php-fpm start
测试,查看phpinfo输出
官方文档:http://docs.php.net/manual/en/pthreads.installation.php#113019
- 安装php扩展pthreads实现PHP多线程 原创qw871122015-04-16 17:01评论(0)948人阅读 下面介绍两种编译方式: 1、在已有的PHP上编译pthreads扩展 注:需
- php安装pthreads多线程扩展
- PHP 多线程扩展 pthreads
- php 多线程 pthreads扩展
- wamp安装pthreads扩展(PHP多线程)
- wamp安装pthreads扩展(PHP多线程)
- wamp安装pthreads扩展(PHP多线程)
- PHP安装pthreads多线程扩展[windows篇]
- PHP多线程扩展pthreads实例
- PHP多线程扩展pthreads示例
- php下pthreads扩展安装
- iis7.0安装php的pthreads扩展
- PHP的pthreads扩展
- php 多线程 pthreads安装
- PHP 多线程扩展(正儿八经的线程)pthreads安装
- PHP安装pthreads多线程扩展教程[windows篇]
- PHP安装pthreads多线程扩展教程[windows篇]
- wamp安装pthreads扩展(PHP多线程) windows
- rabbitMQ第四篇:远程调用
- Unicode&ASCII
- SylixOS在ZYNQ中划分CACHE
- 第十一周 【项目3
- 557. Reverse Words in a String III
- 安装php扩展pthreads实现PHP多线程 原创qw871122015-04-16 17:01评论(0)948人阅读 下面介绍两种编译方式: 1、在已有的PHP上编译pthreads扩展 注:需
- 判断Java 对象实例是否死亡
- 第十一周项目2
- rabbitmq整合spring
- [Java面试四]Strust2总结及在面试中的一些问题
- Eclipse 中web项目报 target runtime apache tomcat XX.XX is not defined.
- 应对新挑战,动态安全技术为“互联网+工会”保驾护航
- 大视野,大续航,360 N6 Pro要搞大事情
- “+AI”而非“AI+”,海尔人工智能如何赋能智慧家庭?