PHP7下安裝event擴展

前言:

有效安排I/O,時間和信號的擴展,使用可用於特定平臺的最佳I/O通知機制的事件,是PHP基礎設施的libevent端口。(目前PHP7不支持libevent)

安裝主持庫libevent,需要編譯高版本

[root@localhost ~]# 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

[root@localhost ~]# cd /usr/local/src

[root@localhost src]# tar -zxvf libevent-2.1.8-stable.tar.gz && cd libevent-2.1.8-stable

[root@localhost libevent-2.1.8-stable]# ./configure --prefix=/usr/local/libevent-2.1.8

[root@localhost libevent-2.1.8-stable]# make && make install


安裝event庫

[root@localhost ~]# wget -c http://pecl.php.net/get/event-2.3.0.tgz -P /usr/local/src

[root@localhost ~]# cd /usr/local/src

[root@localhost src]# tar -zxvf event-2.3.0.tgz && cd event-2.3.0

[root@localhost event-2.3.0]# phpize

[root@localhost event-2.3.0]# ./configure --with-php-config=/usr/local/php7/bin/php-config --with-event-libevent-dir=/usr/local/libevent-2.1.8/

[root@localhost event-2.3.0]# make && make install

修改php.ini配置文件,添加如下:

extension=event.so

重啓php-fpm,查看php -m 查看event庫是否安裝成功!


發佈了40 篇原創文章 · 獲贊 51 · 訪問量 28萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章