3487
xapian安装(PHP版)
乐果 发表于 2014 年 11 月 29 日 标签:xapianPHPubuntu
1、scws安装
sudo wget http://www.xunsearch.com/scws/down/scws-1.2.2.tar.bz2
sudo tar -jxvf scws-1.2.2.tar.bz2
cd scws-1.2.2/
./configure --prefix=/usr/local/scws
sudo make && make install
sudo mkdir /usr/include/scws
ln -sf /usr/local/scws/include/scws /usr/include
sudo ln -s /usr/local/scws/lib/libscws.so.1.1.0 /usr/lib/libscws.so
sudo ln -s /usr/local/scws/lib/libscws.so.1.1.0 /usr/lib/libscws.so.1
安装scws扩展 cd phpext phpize ./configure –with-php-config=PHP_HOME/bin/php-config make make install
下载分词库
http://www.xunsearch.com/scws/down/scws-dict-chs-utf8.tar.bz2
sudo tar -jxvf scws-dict-chs-utf8.tar.bz2
cd scws-dict-chs-utf8
sudo mv dict.utf8.xdb /usr/local/scws/
2、安装xapian核心服务
sudo wget http://oligarchy.co.uk/xapian/1.2.17/xapian-core-1.2.17.tar.xz
sudo xz -d xapian-core-1.2.17.tar.xz
sudo tar xvf xapian-core-1.2.17.tar
cd xapian-core-1.2.17
sudo ./configure –prefix=/usr/local/xapian
如果 报错:
configure: error: Neither uuid/uuid.h nor uuid.h found - required for brass, chert and flint (you may need to install the uuid-dev, libuuid-devel or e2fsprogs-devel package)
ubuntu环境下安装依赖库即可:
sudo apt-get install uuid-dev
报错:
You need a working C++ compiler to compile Xapian
....
xapian ./configure CXX=/opt/bin/c++
ubuntu环境下安装依赖库即可:
sudo apt-get install g++
3、安装xapian客户端(php扩展)
sudo wget http://oligarchy.co.uk/xapian/1.2.17/xapian-bindings-1.2.17.tar.xz
sudo xz -d xapian-bindings-1.2.17.tar.xz
sudo tar xvf xapian-bindings-1.2.17.tar
cd xapian-bindings-1.2.17
sudo ./configure XAPIAN_CONFIG=/usr/local/xapian/bin/xapian-config --with-php PHP_CONFIG=/opt/service/php/bin/php-config