sphinx-php using Sphinx Search technology

Source: Internet
Author: User

There are two ways that Sphinx inherits from the PHP program:

Sphinx PHP Module: Compile and build PHP extension module

Sphinx API classes: Use the classes provided by the Sphinx directly

First we should use Sphinx to do several things:

1). Create MySQL Data

2). Configure the Sphinx configuration file

3). Use indexer to create index files based on Sphinx's configuration data source and index

4). Start the SEARCHD service process and start Port 9312

5). Connect Sphinx Service Using PHP

Using the PHP module form:

1. Install dependent libsphinxclient

This dependent source code is available in the Coreseek installation package, coreseek-3.2.14/csft-3.2.14/api/libsphinxclient

cd/setup/coreseek-3.2. /csft-3.2. /api/libsphinxclient. /configure--prefix=/usr/local/sphinxclientmake make andinstall

2. Download and install the PHP Sphinx extension

wget http://pecl.php.net/get/sphinx-1.3.3.tgztar zxvf sphinx-1.3. 3 . tgz/usr/local/php/bin/phpize. /configure--with-php-config=/usr/local/php/bin/php-config--with-sphinx=/usr/local/sphinxclient/ make  Make Install

3. Add the PHP Sphinx module to the configuration file (choose your own extension directory)

mv /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/sphinx.so/usr/local/php/ ext/

Open/usr/local/php/lib/php.ini, Join extension = sphinx.so

4. Restart PHP-FPM

kill -usr 'cat /var/run/php-fpm.pid ' #php the PID position specified in the-fpm.conf

With Phpinfo (), you can see that the Sphinx extension is now

sphinx-php using Sphinx Search technology

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.