php 5.4 安装 pthreads

转自:https://blog.csdn.net/terry_water/article/details/50252611

 

 

1. 下载地址是这个:

https://github.com/krakjoe/pthreads

但是这个下载的是 版本3 也就是php 7 才能用的

我们需要使用2版本

然后刷新的页面如下,拖到最底部:

在下一页找到版本2的

 

下载下来,这个v2 才是php5才可以使用的

下载下来,安装:

或者,您直接这样下载:

 

[html] view plain copy
 
  1. cd /tools  
  2. wget https://github.com/krakjoe/pthreads/archive/v2.0.10.zip  
  3. unzip   v2.0.10.zip  
  4. cd pthreads-2.0.10  
  5. /usr/local/php/bin/phpize  
  6. ./configure --with-php-config=/usr/local/php/bin/php-config    
  7. make  
  8. make install  

 

 

注意:您的php 在编译的时候需要开启  --enable-maintainer-zts,

 

[html] view plain copy
 
  1. ./configure --prefix=/usr/local/php --disable-fileinfo   --enable-fpm --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-openssl --with-zlib --with-curl --enable-ftp --with-gd --with-xmlrpc  --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --enable-mbstring --with-mcrypt=/usr/local/libmcrypt --enable-zip --with-mysql=/usr/local/mysql --without-pear --enable-maintainer-zts  



 

 

 

[html] view plain copy
 
  1. vim /etc/php.ini  

 

 

添加:

 

[html] view plain copy
 
  1. extension=pthreads.so  

 

 

 

[html] view plain copy
 
  1. 重启php  
  2. /etc/init.d/php-fpm restart  



 

 

 

 

如果用的oninstack 则需要在oneinstack根目下 options.conf 下修改 php_modules_options='--enable-maintainer-zts'

并重新编译php

posted on 2018-06-05 15:37  ziyi_ang  阅读(270)  评论(0编辑  收藏  举报

导航