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