php安装libevent扩展

本来想尝试一下PHP编写高性能网络服务,须要安装libevent扩展,没想到让人很费了点脑壳
先下载libevent扩展:php

http://pecl.php.net/package/libevent/0.0.5git

解压后,开始编译github

1
2
3
网络

cd libevent-0.0.5
/usr/local/php/bin/phpize
$ ./configure --with-php-config=/usr/local/php/bin/php-config性能

结果立刻报错了,错误显示为re2c版本太低。
re2c,PHP的词法解析器,官网:http://re2c.org/,下载最新的版本,编译完成。
继续编译刚才的PHP扩展
结果仍是报错,spa

1
.net

error: Cannot find libevent headersorm

直到这里,确定是没找到libevent的目录,
本地查看是否安装了libevent,
终于在一个目录下找到了libevent-2.0.12-stable目录。
若是未安装,则先需安装libevent。ci

1
2
3
4
5
6
7
get

wget http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz
tar zxvf libevent-2.0.20-stable.tar.gz
cd libevent-2.0.20-stable/
./configure --prefix=/usr/local/libevent-2.0.20-stable/
make
make install
cd ../

OK,继续编译扩展

1
2
3
4

cd libevent-0.0.5
/usr/local/php/bin/phpize
$ ./configure --with-php-config=/usr/local/php/bin/php-config --with-libevent=/usr/local/libevent-2.0.20-stable
make && make install

顺利编译经过

相关文章
相关标签/搜索