wget http://fallabs.com/tokyocabinet/tokyocabinet-1.4.47.tar.gz tar zxvf tokyocabinet-1.4.47.tar.gz cd tokyocabinet-1.4.47 ./configure --prefix=/usr/local/webserver/tc make && make install cd ../
wget http://fallabs.com/tokyotyrant/tokyotyrant-1.1.41.tar.gz tar zxvf tokyotyrant-1.1.41.tar.gz cd tokyotyrant-1.1.41 ./configure --prefix=/usr/local/webserver/tt --with-tc=/usr/local/webserver/tc/ make && make install cd ../
mkdir -p /data1/db/ttserver mkdir -p /data/db/ttserver
mkdir -p /data1/db1/ttserver mkdir -p /data/db1/ttserver
/usr/local/webserver/tt/bin/ttserver -host 127.0.0.1 -port 11212 -thnum 8 -dmn -pid /data1/db/ttserver/ttserver.pid -log /data1/db/ttserver/ttserver.log -le -ulog /data1/db/ttserver/ -ulim 128m -sid 1 -rts /data1/db/ttserver/ttserver.rts /data/db/ttserver/database.tch#bnum=1000000#xmsiz=434217728#rcnum=20000
/usr/local/webserver/tt/bin/ttserver -host 127.0.0.1 -port 1978 -thnum 8 -dmn -pid /data1/db1/ttserver/ttserver.pid -log /data1/db1/ttserver/ttserver.log -le -ulog /data1/db1/ttserver/ -ulim 128m -sid 2 -rts /data1/db1/ttserver/ttserver.rts /data/db1/ttserver/database.tct#bnum=1000000#xmsiz=434217728#rcnum=20000#mode=wcr
wget http://pecl.php.net/get/tokyo_tyrant-0.6.0.tgz tar zxvf tokyo_tyrant-0.6.0.tgz cd tokyo_tyrant-0.6.0 /usr/local/webserver/php/bin/phpize ./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-tokyo-tyrant=/usr/local/webserver/tt/ --with-tokyo-cabinet-dir=/usr/local/webserver/tc/ make cd modules cp tokyo_tyrant.so /usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/ vi /usr/local/webserver/php/etc/php.ini extension = tokyo_tyrant.so
TT测试代码
<?php try { $tt = new TokyoTyrant("192.168.1.100", 11212); }catch (TokyoTyrantException $e) { var_dump($e); exit; } //$tt->put("key", "value"); echo $tt->get("864374523-2");
|
请发表评论