PHP安装libevent扩展

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.tgz

cd libevent-0.0.4

phpize

./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.gz tar -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"

 

转载于:https://www.cnblogs.com/sailrancho/p/3835940.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值