1 下载地址:http://pecl.php.net/package/event
2 安装支持库libevent,需要编译高版本(这里以最新版本release-2.1.8-stable为例)
https://github.com/nmathewson/Libevent.git
./configure --prefix=/usr/local/libevent-2.1.8 make sudo make install
3 安装event库
下载地址: http://pecl.php.net/package/event
wget http://pecl.php.net/get/event-2.3.0.tgz tar -zxvf event-2.3.0.tgz
/usr/local/php-7.1.8/bin/phpize
生成 Makefile,同时指定安装路径,为下一步的编译做准备
./configure --with-php-config=/usr/local/php-7.1.8/bin/php-config --with-event-libevent-dir=/usr/local/libevent-2.1.8/
修改php.ini
extension=/usr/local/php-7.1.8/lib/php/extensions/no-debug-non-zts-20160303/event.so
重启php-fpm 重启nginx
参考地址 https://www.cnblogs.com/tinywan/p/7551533.html