Linux Compiler installation PHP libevent extended instance _javascript tips

Source: Internet
Author: User

Originally wanted to try PHP to write High-performance network services, the need to install Libevent expansion, did not expect to make a lot of head
Download Libevent Extensions First:
Http://pecl.php.net/package/libevent
After decompression, start compiling

Copy Code code as follows:

$ CD Libevent-version
$/usr/local/php/bin/phpize
$./configure--with-php-config=/usr/local/php/bin/php-config

The results are immediately incorrect, the error displayed as RE2C version is too low.

Re2c,php's lexical parser, official website: http://re2c.org/, download the latest version, compile complete.

Continue compiling the PHP extensions just now

The result is still an error.

Copy Code code as follows:

Error:cannot Find Libevent Headers

Until here, there must have been no directory of libevent found,
To see if the libevent is installed locally,
Finally found the Libevent-2.0.12-stable directory under a directory.
If it is not installed, you need to install Libevent first.
Copy Code code 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 compiling the extension
Copy Code code as follows:

$ CD libevent-0.0.5
$/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

Smoothly compiled through

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.