0

I do not have root access to the computer I'm working with, so I cannot simply use a package manager to install the programs I need. As such, I've been compiling them from source. I've compiled Apache and PHP successfully and have a wiki hosted. I would now like to use SphinxSearch with the MediaWiki setup.

I am using SQLite for the database, and there are instructions for using SphinxSearch with SQLite, which requires SphinxSearch to be compiled with libexpat.

I have been trying for a while to get SphinxSearch to compile with XML support, but I just can't seem to get it. The only help I've found online says to install libexpat and libexpat-dev like so

apt-get install libexpat libexpat-dev

However, since I'm not root, I can't simply install like that. So I compiled libexpat from source:

wget http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz/download
tar xf expat-2.1.0.tar.gz
cd expat-2.1.0/
./configure --prefix=${BASE_PATH}/expat-2.1.0
make
make install

Which compiles libexpat perfectly fine. Next, I've added the libexpat to the LD_LIBRARY_PATH and C_INCLUDE_PATH like so:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${BASE_PATH}/expat-2.1.0/lib"
export C_INCLUDE_PATH="$C_INCLUDE_PATH:${BASE_PATH}/expat-2.1.0/include"

Then I go to compile Sphinx:

wget http://sphinxsearch.com/files/sphinx-2.2.7-release.tar.gz
tar xf sphinx-2.2.7-release.tar.gz
cd sphinx-2.2.7-release
./configure --prefix=${BASE_PATH}/sphinx-2.2.7 --without-mysql --with-libexpat

However, the output from configure gives:

...
checking whether to compile with re2 library support... no
checking whether to compile with RLP library support... no
checking for libexpat... checking for library containing XML_Parse... no
not found
configure: WARNING: xmlpipe2 will NOT be available
checking for libiconv... checking for library containing iconv... none required
found
checking for iconv() arg types... char **
...

So, do you know how to can get Sphinx to find a library containing "XML_Parse"?

UPDATE: So I was able to resolve it by compiling in a VM (see my posted answer below for more details), but that's a rather lengthy solution to what should be a simple problem. As such, if someone posts a better solution, I'll mark that as the best answer.

Nemo
  • 2,441
  • 2
  • 29
  • 63
Alex
  • 557
  • 2
  • 8
  • 15
  • have you tried just using one of the precompiled packages, but just manually extracting the binaries from the package (rather than using a package manager to install ) dpkg can simply extract the contents. – barryhunter Mar 05 '15 at 17:07
  • I downloaded the RHEL5 (the version of Linux this is) RPM from the Sphinx website, extracted it and got all of the config set up to work with the MediaWiki. Once I finally ran it, it appears that it depends on having MySQL installed. `error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory` – Alex Mar 05 '15 at 17:49

1 Answers1

1

I was able to resolve this by setting up a virtual machine (with VirtualBox) and installing an equivalent version of Linux in it (the server I'm connecting to is running RHEL5, so I installed CentOS 5). Then, on the VM I set up an environment using:

yum groupinstall "Development tools"
yum install expat-devel

Then, I followed the normal compile that I tried to do on the main server. Once I completed, I just tar/gzip the resulting Sphinx folder and transferred it to the main server. Everything worked perfectly.

NOTE: When compiling Sphinx on the VM, make sure you set up the exact directory structure Sphinx will be installed in. Sphinx compiles with the output prefix inside of the executable, so it needs to have the path set up exactly the way you want it to be. I don't know why they don't just pull all of the required paths from the config file(s).

Alex
  • 557
  • 2
  • 8
  • 15
  • As for the path, the prefix is used to find the config file (if its not specified on the command line) - sort of chicken and the egg. Other than finding the config file that prefix isnt used for a whole lot. – barryhunter Mar 06 '15 at 11:00