What the hell is Xapian ?
Xapian is a "Xapian" is an open source probabilistic information retrieval library, based on the GPL release. It is written in C + + and provides bindings that support other languages (Perl, Python, PHP, Java, and TCL) development. 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 section on the Internet, I itch to try xapian--must give PHP the whole thing up. After referencing several documents, this starts to work (my environment is still FreeBSD + Apache 2.2 + PHP 5.1.2, Apache and PHP are already 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 Xapian's core Lib code, which is the interface to other languages
2. Install 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. Install 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 #这里需要做个软连接, you need to use the./configure–without-python #我没用到python when compiling, do not compile make made install
In this step, xapian-bindings should be installed, but do not know why, the compiled xapian.so not according to the description of the document is automatically copied to the PHP extension directory, so I manually completed 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 completed, restart Apache to see phpinfo: