What the hell is Xapian?
Xapian is a "Xapian is an open source probability theory information retrieval library, published based on the GPL. It is written in C + + and provides bindings to support the development of other languages (Perl, Python, PHP, Java, and TCL). Xapian is designed to be a highly adaptable toolset that allows developers to easily add advanced indexing and search capabilities to their own applications. ”
Find this paragraph on the Internet after the introduction, my hands itch to try xapian--must give PHP the whole thing up. After referencing several documents, it started (my environment is still FreeBSD + Apache 2.2 + PHP 5.1.2, Apache and PHP have already been installed.):
1. Download Xapian
Cd/usr/local/src
wget http://www.oligarchy.co.uk/xapian/0.9.4/xapian-core-0.9.4.tar.gz
wget http://www.oligarchy.co.uk/xapian/0.9.4/xapian-bindings-0.9.4.tar.gz
The former is the core Lib code of Xapian, which is the interface to other language calls
2. Installing Xapian-core
Cd/usr/local/src
Tar xzvf xapian-core-0.9.4.tar.gz
CD xapian-core-0.9.4
./configure–prefix=/usr/local/xapian
Make
Make install
3. Installing Xapian-bindings
Cd/usr/local/src
Tar xzvf xapian-bindings-0.9.4.tar.gz
CD xapian-bindings-0.9.4
Ln-s/usr/local/xapian/bin/xapian-config/usr/local/bin/xapian-config #这里需要做个软连接, it needs to be compiled.
./configure–without-python #我没用到python, it's not compiled.
Make
Make install
In this step, xapian-bindings should be installed, but do not know why, the compiled xapian.so did not follow the description of the document automatically copied to the PHP extension directory, so I manually complete this step
CP php/.libs/xapian.so/usr/local/lib/php #/usr/local/lib/php is the extension directory I set up in php.ini
Then modify the php.ini
Extension_dir = "/usr/local/lib/php/" #没有就加上
Extension=xapian.so
Install all done, reboot Apache to see phpinfo:
Everything OK:)