Here are two ways to compile:
1. Compiling pthreads extensions on existing PHP
Note: You need to dynamically load the Pthreads module, you must enable--ENABLE-MAINTAINER-ZTS before compiling PHP, otherwise you will need to recompile PHP.
Pthreads Source Package Download Address: 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. Recompile php, load 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 will pthreads decompression, move to php/ext/, and renamed to Pthreads;
Come to PHP source directory
./buildconf--force
./configure--help | grep thread
Whether you can see--enable-threads, if not, execute:
RM-RF ACLOCAL.M4
RM-RF autom4te.cache/
./buildconf--force
Initialize the compilation configuration:
./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
Start PHP-FPM
/ETC/INIT.D/PHP-FPM start
Test, view phpinfo output
Official Document: http://docs.php.net/manual/en/pthreads.installation.php#113019