What is xapian
? ). Xapian is designed to be a highly adaptable toolset that allows developers to easily add advanced indexing and search capabilities to their own applications.”
After finding this introduction online, I wanted to try it. xapian —- Be sure to get the whole thing for PHP. After referring to several documents, I started to do it (my environment is still freebsd + apache 2.2 + php 5.1.2, apache and php are already installed):
1. Download xapian
The former is the core lib code of xapian, and the latter is the interface called by 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 #A soft link needs to be made here, which is needed when compiling
./configure –without-python #I don’t use python, so I won’t compile it.
make
make install
, Xapian-bindings should be installed, but for some reason, the compiled xapian.so was not automatically copied to the extension directory of PHP as stated in the documentation, so I completed this step manually
cp php/.libs/xapian.so /usr/local/lib/php #/usr/local/lib/php is the extension directory I set in php.ini
and then modify php.ini
extension_dir = “/usr/local/lib/php/” #If not, add it
extension=xapian.so
installation is complete, restart apache and check phpinfo:
Everything is ok :)