Method of Installing event Extension under php7

  • 2021-09-12 00:43:20
  • OfStack

Events that efficiently schedule I/O, time, and signal extensions using the best I/O notification mechanism available for a particular platform are the libevent ports of the PHP infrastructure.

Download address: http://pecl.php.net/package/event

To install the support library libevent, you need to compile a higher version (take the latest version release-2. 1.8-stable as an example)


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

Install the event library (take event-2. 3.0. tgz as an example)


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

Add the following configuration in php. ini


extension=event.so

After restarting php-fpm, use php-m grep event to see if the event library plug-in was installed successfully


Related articles: