1. 下载扩展官方地址http://pecl.php.net/package/libevent请根据自己的PHP脚本选择相应版本
如
wget http://pecl.php.net/get/libevent-0.0.4.tgz
2. 下载 wget http://pecl.php.net/get/libevent-0.0.4.tgz解压 tar -zxvf libevent-0.0.4.tgzcd libevent-0.0.4phpize./configure --with-php-config=/local/php/bin/php-config发现报错 显示为re2c版本过低 从http://www.re2c.org/ 下载 wget http://sourceforge.net/projects/re2c/files/re2c/0.13.5/re2c-0.13.5.tar.gz/download安装之继续./configure --with-php-config=/local/php/bin/php-config报错 Cannot find libevent headers 需要安装libevent下载 libevent 官网 http://libevent.org/ wget https://github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gztar -zxvf libevent-2.0.20-stable.tar.gz cd libevent-2.0.20-stable./configure --prefix=/local/libevent-2.0.20-stable/make && make install再次安装扩展,加入 --with-libevent
./configure --with-php-config=/home/users/suqian/.jumbo/php/bin/php-config --with-libevent=/local/libevent-2.0.20-stable/make && make install 之后配置 php.ini 移动 生成的 .so 文件到 php.ini 中配置的 extensions_dir下
并添加配置extension="libevent.so"