php7下安装event扩展

Event是什么

This is an extension to efficiently schedule I/O, time and signal based events using the best I/O notification mechanism available for specific platform. This is a port of libevent to the PHP infrastructure

1:首先安装支持库libevent,不能用yum,要自己编译高版本的

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

2:编译扩展

wget https://pecl.php.net/get/event-2.0.4.tgz
tar -zxvf event-2.0.4.tgz
cd event-2.0.4
/usr/local/php7/bin/phpize
./configure --with-php-config=/usr/local/php7/bin/php-config --with-event-libevent-dir=/usr/local/libevent-2.0.22/
make
make install

3:修改php.ini增加event.so文件即可

下篇文章再写如何使用event扩展

此条目发表在 好文推荐, 网站开发 分类目录,贴了 , 标签。将固定链接加入收藏夹。

评论功能已关闭。