网站首页

php7下安装event扩展

中文Lee 2020/04/11 1229人围观
PHP  

一·、安装支持库libevent,需要编译高版本(这里以最新版本release-2.1.8-stable为例)


1. wget -c https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz -P /usr/local/src

2. cd /usr/local/src

3. tar -zxvf libevent-2.1.8-stable.tar.gz && cd libevent-2.1.8-stable

4. ./configure --prefix=/usr/local/libevent-2.1.8

5. make && make install


二、安装event库(以event-2.3.0.tgz为例)

1. wget -c http://pecl.php.net/get/event-2.3.0.tgz -P /usr/local/src

2. cd /usr/local/src

3. tar -zxvf event-2.3.0.tgz && cd event-2.3.0

4. /usr/local/php/bin/phpize

5. ./configure --with-php-config=php-config的路径(你自己的路径) --with-event-libevent-dir=/usr/local/libevent-2.1.8/

6. make && make install



三、在php.ini添加下面配置


1. extension=event.so;


重启php-fpm


相关推荐