Installing Sphinx


Sphinx is available via MacPorts - but this comes with one important caveat: You must have MySQL and/or PostgreSQL installed via MacPorts as well. If you don’t, then compiling by source is the best approach. Download and try the following set of commands. If you need PostgreSQL support though, scroll down and look at the UNIX section.

sudo make install  

There are two common issues that people run into. The first is that iconv and/or the expat XML parser may need to be updated. Clinton Nixon has written some clear instructions on how to handle that.

The other issue only appears when you actually index your data or start the daemon:

dyld: Library not loaded: \\  
 Referenced from: /usr/local/bin/indexer  
 Reason: image not found  

A quick fix for this is to add a symlink from where the MySQL libraries are to where Sphinx expects them to be:

sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql  

You may need to recompile and reinstall Sphinx once this is done.


If you’re running Gentoo, then Sphinx is available via portage. Unfortunately, Debian and Ubuntu users have no such luck, and will have to compile via source. I don’t know what the status is for other distributions and package management tools.

Compiling by source should be quite painless though. Download the code from the Sphinx website - version is the most recent stable release at the moment. The standard set of commands should install it with MySQL support:

sudo make install  

If you need PostgreSQL support, you’ll need to tell the Sphinx configuration step that. It could be as simple as a flag:

./configure —with-pgsql  

But in some cases the path to the libraries will need to be explicitly set:

./configure —with-pgsql=/usr/local/include/postgresql  

The libraries path can be determined by running the following command:

pg\_config —pkgincludedir  


If you’re installing Sphinx on Windows, then all you should have to do is grab the relevant installer from the Sphinx website (one has PostgreSQL and MySQL support, one is just for MySQL). Install, and you’re good to go.