If you already have MAMP installed then follow these steps to configure MAMP and install Sphinx Search.
By default, MAMP is missing someÂ componentsÂ that Sphinx requires. These steps will upgrade your MAMP install with the required components.
DownloadÂ MAMP_components_1.9.dmg. After the file is done downloading double click on it to mount the DMG. Once the DMG is mounted navigate to the MAMP_src folder.Â
Once in the folder find the mysql-5.1.44.tar.gz file. Once you find the file drag it to your downloads folder. Once in Downloads double click onÂ mysql-5.1.44.tar.gz to extract it.
Next, startup Terminal and enter the followingÂ
and hit enter.
Now enter the following, this will configure MySQL for your system:
sudo ./configure --with-unix-socket-path=/Applications/MAMP/tmp/mysql/mysql.sock --without-server --prefix=/Applications/MAMP/Library
Then enter the text below, this will compile MySQL:
sudo make -j2
This command will copy the libs to your MAMP directory
sudo cp libmysql/.libs/*.dylib /Applications/MAMP/Library/lib/mysql
The next two commands make a directory and then copy the header files.
sudo mkdir /Applications/MAMP/Library/includeÂ
sudo cp -R include /Applications/MAMP/Library/include/mysql
Change to your home directory:
Download Sphinx 1.10 Beta:
curl -L -O http://www.sphinxsearch.com/downloads/sphinx-1.10-beta.tar.gz
tar -xzf sphinx-1.10-beta.tar.gz
Change to the Sphinx directory:
Download the libstemmer source code. this is so Sphinx can get to the root of a word:Â
curl -O http://snowball.tartarus.org/dist/libstemmer_c.tgz
tar -xzf libstemmer_c.tgz
Configure the Sphinx installer: Note, there are two ways to install Sphinx you can use the command below to install Sphinx into the local directory or you can give Sphinx its own directory in local with the second command.Â Make sure to only run one of the commands though.
sudo ./configure --prefix=/usr/local --with-libstemmer --with-mysql=/Applications/MAMP/Library
sudo ./configure --prefix=/usr/local/sphinx --with-libstemmer --with-mysql=/Applications/MAMP/Library
sudo make install
You should now have Sphinx installed in your /etc/local directory or your /etc/local/sphinx directory depending on how you installed it.