Linux下leveldb安装及PHP扩展

文章来源:http://dreamans.com/post/2.html

获取leveldb:http://code.google.com/p/leveldb/ 
安装leveldb:

wget http://leveldb.googlecode.com/files/leveldb-1.5.0.tar.gz
tar zxvf leveldb-1.5.0.tar.gz
cd leveldb-1.5.0
make

获取并安装leveldb-php扩展

$ git clone https://github.com/reeze/php-leveldb.git
$ cd php-leveldb
$ phpize
$ ./configure --with-leveldb=/path/to/your/leveldb-1.*.* --with-php-config=/phppath/bin/php-config
$ make
$ make install

安装完毕,小测一下:

leveldb写入:
memory used: 0.421875KB
time used: 47.121001005173 S
string len: 27
data items: 10000000

PHP文件写入:
memory used: 1.2578125KB
time used: 51.63488483429
string len: 27
data items: 5000000

使用方法链接:https://github.com/reeze/php-leveldb/

原文地址:https://www.cnblogs.com/dreamans/p/2709683.html