您好,欢迎访问一九零五行业门户网

linux编译安装php libevent扩展库

linux编译安装php libevent扩展的方法,在php编程中实现高性能的网络服务,需要libevent扩展库的支持,本文通过编译源码的方式安装libevent扩展库。php编写高性能网络服务,需要安装libevent扩展。
1、下载libevent扩展: http://pecl.php.net/package/libevent
2、解压后,开始编译
$ cd libevent-version$ /usr/local/php/bin/phpize$ ./configure --with-php-config=/usr/local/php/bin/php-config报错,错误显示为re2c版本过低。re2c,php的词法解析器,官网:http://re2c.org/,下载最新的版本,编译完成。继续编译刚才的php扩展,仍然报错error: cannot find libevent headers
直到这里,肯定是没找到libevent的目录, 本地查看是否安装了libevent, 终于在一个目录下找到了libevent-2.0.12-stable目录。 3、如果未安装,则先需安装libevent。
wget http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gztar zxvf libevent-2.0.20-stable.tar.gzcd libevent-2.0.20-stable/./configure --prefix=/usr/local/libevent-2.0.20-stable/makemake installcd ../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 这次编译通过了。
其它类似信息

推荐信息