CentOS6.4 X64 installation Sphinx and Sphinx for PHP extensions

Source: Internet
Author: User


Before installing, make sure you have installed the most common components, and then download the latest Sphinx on the official website.


Yum install-y python Python-devel
http://sphinxsearch.com/downloads/release/

Please use the stable version, the online machine can not play the beta version!

Install Sphinx

Tar zxvf sphinx-2.1.4-release.tar.gz
CD Sphinx-2.1.4-release
./configure--prefix=/usr/local/sphinx–-with-mysql
Make && make install

If undefined reference to Libiconv error occurs at make

Error description

/usr/local/sphinx/src/sphinx.cpp:20060:undefined reference to ' Libiconv_open '
/usr/local/sphinx/src/sphinx.cpp:20078:undefined reference to ' Libiconv '
/usr/local/sphinx/src/sphinx.cpp:20084:undefined reference to ' Libiconv_close '
Collect2:ld returned 1exit status
MAKE[2]:* **[indexer]error1 www.111cn.net
make[2]:leaving directory '/HOME/SPHINX/SRC '
MAKE[1]: * * * [ALL] Error 2
MAKE[1]: Leaving directory '/HOME/SPHINX/SRC '
Make: * * * [all-recursive] Error 1

Solution:


Open the Configure file, find "#define USE_LIBICONV 1", remove the annotation, and change the 1 to 0.


Libsphinxclient Installation (PHP module required)


CD api/libsphinxclient
./configure–prefix=/usr/local/sphinx
Make && make install

Install the PHP Sphinx module www.111cn.net


Download Address: Http://pecl.php.net/package/sphinx


wget http://pecl.php.net/get/sphinx-1.3.0.tgz
Tar zxf sphinx-1.3.0.tgz
CD sphinx-1.3.0
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config--with-sphinx=/usr/local/sphinx/
Make && make install

After installation, in the installation directory, etc directory, there is a test data and configuration of the sample


Cd/usr/local/sphinx/etc
CP Sphinx.conf.dist Sphinx.conf will sphinx.conf inside of the database address, account password to change the good, and then Lvtao.sql

Guide Database Lvtao

Test execution


/usr/local/sphinx/bin/search Lvtao can see some information about the query.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.