1、下载event源码包https://pecl.php.net/package/event如:event-2.0.4.tgz2、解压> tar zxvf event-2.0.4.tgz> cd event-2.0.43、通过phpize命令生成configure> /data/nmp/php/bin/phpize(*如上路径只作演示,具体视安装环境而定。)4、生成好后,运行configure> ./configure --with-php-config=/data/nmp/php/bin/php-config --with-event-libevent-dir=/usr/local/libevent5、make && make install> make> make install6、如果出现如下信息,说明成功Installing shared extensions: /data/nmp/php/lib/php/extensions/no-debug-non-zts-20151012/7、修改php.ini文件extension_dir = "/data/nmp/php/lib/php/extensions/no-debug-non-zts-20151012/"extension=event.so8、重启服务器,查看phpinfo()