Compiling and installing phplibevent extension in Linux _ javascript skills

Source: Internet
Author: User
This article describes how to compile and install phplibevent extension instances in Linux. This article focuses on an error solution during compilation, if you want to write a high-performance network service in PHP, you can refer to the following. You need to install the libevent extension.
Download the libevent extension first:
Http://pecl.php.net/package/libevent
Decompress the package and start compiling.

The Code is as follows:


$ Cd libevent-version
$/Usr/local/php/bin/phpize
$./Configure -- with-php-config =/usr/local/php/bin/php-config


An error is reported immediately, indicating that the re2c version is too low.

Re2c: PHP lexical parser. Official Website: http://re2c.org/. download the latest version and compile it.

Continue to compile the PHP extension just now

An error is returned.

The Code is as follows:


Error: Cannot find libevent headers


Till now, the libevent directory is definitely not found,
Check whether libevent is installed locally,
Finally found the libevent-2.0.12-stable directory under a directory.
If not, install libevent first.

The Code is as follows:


Wget http://cloud.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 =/usr/local/libevent-2.0.20-stable/
Make
Make install
Cd ../


OK, continue compilation Extension

The Code is as follows:


$ Libevent-0.0.5 cd
$/Usr/local/php/bin/phpize
$./Configure -- with-php-config =/usr/local/php/bin/php-config -- with-libevent =/usr/local/libevent-2.0.20-stable
$ Make & make install


Compiled successfully

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.