当前位置:首页 > 教程/笔记 > 正文内容

php7.2 编译安装event扩展

下载地址:http://pecl.php.net/package/event

安装event扩展,需要安装基础库libevent

安装libevent:

cd /usr/local/src
wget -c https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar -zxvf libevent-2.1.8-stable.tar.gz && cd libevent-2.1.8-stable
./configure --prefix=/usr/local/libevent-2.1.8
make && make install

安装event:

cd /usr/local/src
wget http://pecl.php.net/get/event-2.3.0.tgz
tar -zxvf event-2.3.0.tgz && cd event-2.3.0
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-event-libevent-dir=/usr/local/libevent-2.1.8/
make && make install

在/usr/local/php/etc/ 目录下,复制php.ini 为php-cli.ini 添加下面配置

extension=event.so

测试:

php-m | grep event
上一篇:Centos7上安装docker (2018-11-20)
下一篇:Ubuntu下多个gcc版本切换总结 (2019-04-30)