ActPHP 環(huán)境安裝步驟

1 安裝php7

使用線程安全的配置 --enable-maintainer-zts

重新編譯的時候如果報錯,則執(zhí)行make clean

2 安裝libevent庫 并且 yum install libevent-dev libevent-dev提供了開發(fā)的頭文件

http://libevent.org/ 下載

      # cd /tmp

      # wget http://www.monkey.org/~provos/libevent-1.2.tar.gz

      # tar zxvf libevent-1.2.tar.gz

      # cd libevent-1.2

      # ./configure –prefix=/usr

      # make

      # make install

3 安裝event擴展 ,

http://pecl.php.net/package/event

wget -O event-2.4.1.tgz http://pecl.php.net/get/event-2.4.1.tgz

在zts模式下,安裝2.4.0成功,安裝2.4.1失敗。

wget -O event-2.4.0.tgz http://pecl.php.net/get/event-2.4.0.tgz

tar -xvf event-2.4.1.tgz

phpize

./configure --with-php-config=/apps/php/bin/php-config --with-event-libevent-dir=/usr/

make && make install

在php.ini添加下面配置

extension=event.so

4 安裝php libevent擴展 (取消該步驟,可用于php5.6,libevent擴展沒人維護了,PHP下不要安裝了。)

http://pecl.php.net/package/libevent http://pecl.php.net/get/libevent-0.1.0.tgz

tar zxvf libevent-0.1.0.tgz

cd libevent-0.1.0

phpize

./configure --with-php-config=/apps/php/bin/php-config

如果報錯:Cannot find autoconf

安裝autoconf

wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz

tar -zvxf m4-1.4.9.tar.gz

cd m4-1.4.9/

./configure && make && make install

cd ../

wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz

tar -zvxf autoconf-2.62.tar.gz

cd autoconf-2.62/

./configure && make && make install

如果安裝autoconf的過程中報錯:(Can't locate Data/Dumper.pm in @INC (@INC contains: ../lib /usr/local/lib64/perl5)

用yum 安裝perl

yum install 'perl(Data::Dumper)'

再次安裝autoconf

再次安裝libevent擴展

./configure --with-php-config=/apps/php/bin/php-config --with-libevent=/usr/

5 安裝 pthreads

github去下載pthreads的3.1版本

pthreads/tree/v3.1.0 支持php7+

  • cd pthreads
  • phpize
  • ./configure
  • make
  • make install (may need sudo)
  • Update your php.ini file to load the pthreads.so file using the extension directive
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。