怎么在php7项目中安装event扩展

安装支持库libevent

wget -c https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz -P /usr/local/src
cd /usr/local/src
tar -zxvf libevent-2.1.8-stable.tar.gz && cd libevent-2.1.8-stable
./configure --prefix=/usr/local/libevent-2.1.8
make && make install

安装event库(以event-2.3.0.tgz为例)

wget -c http://pecl.php.net/get/event-2.3.0.tgz -P /usr/local/src
cd /usr/local/src
tar -zxvf event-2.3.0.tgz && cd event-2.3.0
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-event-libevent-dir=/usr/local/libevent-2.1.8/
make && make install

在php.ini添加下面配置

extension=event.so

重启php-fpm后,使用php -m | grep event 查看event库插件是否安装成功

原创文章,作者:OWGFI,如若转载,请注明出处:http://www.wangzhanshi.com/n/9494.html

(0)
OWGFI的头像OWGFI
上一篇 2025年1月1日 16:46:40
下一篇 2025年1月1日 16:46:42

相关推荐

发表回复

登录后才能评论