centos php5.6是yum安装的
pthread2.x支持php5
3.x支持php7
下载:
wget http://pecl.php.net/get/pthreads-2.0.10.tgz
tar zxvf pthreads-2.0.10.tgz
cd pthreads-2.0.10
安装phpize
yum install php56-php-devel
默认没加关联,需要增加快捷方式
ln -s /opt/remi/php56/root/usr/bin/phpize /usr/bin/phpize
ln -s /opt/remi/php56/root/usr/bin/php-config /usr/bin/php-config
phpize
编译
./configure --with-php-config=/usr/bin/php-config
提示:
checking checking for ZTS… configure: error: pthreads requires ZTS, please re-compile PHP with ZTS enabled
我擦,我找的3方源php56是非线程安全的….擦擦擦
重新编译安装后
#编译安装php关联
ln -s /usr/local/php5622/bin/phpize /usr/bin/phpize56
./configure --with-php-config=/usr/local/php5622/bin/php-config
make
make install
php.ini中增加
extension=pthreads.so
php56 -i |grep pthreads -A 5
成功打印pthread 版本