I just compiled and installed Xapian on my MacBook Pro (OS-X 10.6.6) using the instructions from the Xapian installation guide. The first time I compiled Xapian, everything looked ok, but when I tried to run the extension, it appeared to be compiled in the wrong OS Architecture (64-bit, which is the default for gcc aparently, while MAMP and its PHP5 version are compiled in 32-bit). So make sure you add the CXX='g++ -m32' option when you run ./configure. If you are not sure if the extension is built in 32-bit, just check by running
file xapian.so
on the resulting xapian.so file after the build, which should result in something like this :
$ file xapian.so
xapian.so: Mach-O bundle i386
Here’s the sequence for building the Xapian core and bindings (make sure you download and use the latest stable Xapian version) :
curl -O http://oligarchy.co.uk/xapian/1.1.4/xapian-core-1.1.4.tar.gz
curl -O http://oligarchy.co.uk/xapian/1.1.4/xapian-bindings-1.1.4.tar.gz
tar xvzf xapian-core-1.1.4.tar.gz
tar xvzf xapian-bindings-1.1.4.tar.gz
cd xapian-core-1.1.4
./configure CXX='g++ -m32'
make
sudo make install
cd ..
cd xapian-bindings-1.1.4
./configure CXX='g++ -m32' --with-php
make
sudo make install
cd ..
rm xapian-core-1.1.4.tar.gz
rm xapian-bindings-1.1.4.tar.gz
This will install the PHP bindings with the default OS-X Apache and PHP version, but as I am using MAMP for my development, I will need to perform some extra steps.
Read more »
Recent Comments