安装php扩展pthreads实现PHP多线程
2015-04-16 17:01
483 查看
下面介绍两种编译方式:
1、在已有的PHP上编译pthreads扩展
注:需要动态加载pthreads模块,之前在编译php时必须启用--enable-maintainer-zts;否则需要重新编译PHP。
pthreads源码包下载地址:http://pecl.php.net/package/pthreads
tar xf pthreads-1.0.0.tgz
cd pthreads-1.0.0
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-1.0.0.tgz
mv pthreads-1.0.0 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
本文出自 “突破舒适区” 博客,请务必保留此出处http://tchuairen.blog.51cto.com/3848118/1633510
1、在已有的PHP上编译pthreads扩展
注:需要动态加载pthreads模块,之前在编译php时必须启用--enable-maintainer-zts;否则需要重新编译PHP。
pthreads源码包下载地址:http://pecl.php.net/package/pthreads
tar xf pthreads-1.0.0.tgz
cd pthreads-1.0.0
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-1.0.0.tgz
mv pthreads-1.0.0 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
本文出自 “突破舒适区” 博客,请务必保留此出处http://tchuairen.blog.51cto.com/3848118/1633510
相关文章推荐
- 安装php扩展pthreads实现PHP多线程 原创qw871122015-04-16 17:01评论(0)948人阅读 下面介绍两种编译方式: 1、在已有的PHP上编译pthreads扩展 注:需
- Windows下PHP多线程扩展pthreads的安装
- Windows下PHP多线程扩展pthreads的安装
- wamp安装pthreads扩展(PHP多线程)
- wamp安装pthreads扩展(PHP多线程) windows
- windows下安装php真正的多线程扩展pthreads教程
- wamp安装pthreads扩展(PHP多线程)
- wamp安装pthreads扩展(PHP多线程)
- windows下安装php真正的多线程扩展pthreads教程
- windows下xampp安装PHP的pthreads多线程扩展
- windows下安装php真正的多线程扩展pthreads教程
- wamp安装pthreads扩展(PHP多线程)
- PHP多线程扩展 pthreads 安装
- PHP 多线程扩展(正儿八经的线程)pthreads安装
- PHP 多线程扩展(正儿八经的线程)pthreads安装
- php pthreads 多线程扩展的使用:一个较为稳定例子。
- php pthreads 多线程扩展的使用:一个较为稳定例子。
- Windows下安装php_rar 扩展,让php实现rar文件的读取和解压
- Windows下安装php_rar 扩展,让php实现rar文件的读取和解压
- PHP 多线程扩展 pthreads