这里讲的是如何编译安装pthreads,之后编译安装其余PHP扩展能够参考此方法。php
下载pthreads源码:http://pecl.php.net/package/pthreadsgit
首先肯定安装的php版本是线程安全的,若是不是的话从新编译加上 --enable-maintainer-zts \github
1.解压tar -zxvf pthreads-0.0.44.tgz ;安全
2.进入源码文件夹 cd pthreads-0.0.44 执行 /usr/local/php/bin/phpize;php7
3.执行./configure --with-php-config=\usr/local/php/bin/php-config;网站
4.执行make && make install;spa
5.编辑/usr/local/php/lib/php.ini加上extension=pthreads.so.net
6.重启php就好了...线程
pecl install pthreads
若是在pecl.php.net网站下载的包安装时---> config都对的,make时出错:code
#include "ext/standard/php_smart_str.h"
这个好像是什么位置很少
直接在github下载安装:https://github.com/krakjoe/pthreads (能够安装)
pecl.php.net网站下载 (我安装php7以上的pthreads就报错了,)
错误信息(配置问题) : https://blog.csdn.net/hxmcnu/article/details/53268951
https://blog.csdn.net/woshixiongjin/article/details/22377563