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