PHP 7 Compile and install open Libevent extension support

Source: Internet
Author: User

Libevent is an event-driven, high-performance network library.

Supports multiple I/O multiplexing Technologies, Epoll, poll, Dev/poll, select, and Kqueue, support for events such as I/O, timers and Signals, and register event priorities.

Effectively arranging I/O, time and signal expansion using events that are available for the best I/O notification mechanism for a particular platform, is the libevent port of the PHP infrastructure.


The libevent extension relies on the original Libevent library, and the Libevent library must be installed first.

Libevent Project on GitHub Project address: https://github.com/nmathewson/Libevent


Download Libevent Source code

# git clone # cd libevent#./configure--prefix=/usr/local/libevent-2.1.8 # make && make install


Install the event library (take event-2.3.0.tgz as an example) (in addition, PHP must turn on the sockets function, when compiling PHP to turn on --enable-sockets)

# wget # tar XF event-2.3.0.tgz# cd event-2.3.0# phpize#./configure--with-php-config=/usr/local/php/bin/php-config--wi th-event-libevent-dir=/usr/local/libevent-2.1.8/# make && make install


Locate the PHP configuration file php.ini, and add the following configuration:

Extension=event.so

OK, installation complete, execute Php-i | Grep-i event to see if there are relevant module information.


For the PHP-FPM service, restart the service to load the new environment.

Related development help documents see: Http://php.net/manual/zh/book.libevent.php

This article is from the "Professor" blog, please be sure to keep this source http://professor.blog.51cto.com/996189/1918673

PHP 7 Compile and install open Libevent extension support

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.