1、php的libevent扩展依赖于系统的libevent库,所以必须先把libevent库安装上。
> yum -y install libevent-devel
2、下载libevent扩展
在 http://pecl.php.net/package/libevent 中找到合适的版本
3、解压安装包
> tar -zxvf libevent-0.1.0.tgz
4、进入目录,通过phpize命令生成configure (*我的PHP安装在/data/php下)
> cd libevent-0.1.0
> /data/php/bin/phpize
5、运行configure
> ./configure --with-php-config=/data/php/bin/php-config
6、make & make install
> make
> make install
7、在/data/php/lib/php.ini中添加
extension=libevent.so
8、重启服务器