一、安装libevent库1、到libevent官网下载安装源码http://libevent.org/如:libevent-2.0.22-stable.tar.gz2、解压源码包> tar zxvf libevent-2.0.22-stable.tar.gz> cd libevent-2.0.22-stable3、configure> ./configure --prefix=/usr/local/libevent4、make && make install> make> make install二、安装php的libevent扩展1、下载地址如下:http://pecl.php.net/package/libevent如:libevent-0.1.0.tgz2、解压> tar zxvf libevent-0.1.0.tgz3、通过phpize命令生成configure> /data/nmp/php/bin/phpize(*如上路径只作演示,具体视安装环境而定。)4、生成好后,运行configure> ./configure --with-php-config=/data/nmp/php/bin/php-config --with-libevent=/usr/local/libevent5、make && make install> make> make install6、修改php.ini文件,添加如下extension=libevent.so7、重启服务器