下载php7.2.6
wget http://cn2.php.net/distributions/php-7.2.6.tar.gz
注意: 安装pthreads 扩展编译php时,要带上 --enable-maintainer-zts 参数
安装php可以参照 https://mp.csdn.net/postedit/85202623
下载pthreads扩展并安装
wget https://github.com/krakjoe/pthreads/archive/v3.2.0.tar.gz
tar -zxvf v3.2.0.tar.gz
cd pthreads-3.2.0
/opt/php-7.2.6/bin/phpize
./configure --with-php-config=/opt/php-7.2.6/bin/php-config
make && make install
设置pthreads扩展参数,php7这里和其他扩展参数设置有区别
cd /opt/php-7.2.6/etc/
cp php.ini php-cli.ini
vim php-cli.ini
添加:extension = pthreads.so
重启php,查看
/opt/php-7.2.6/bin/php -m |grep pthreads