Official address: Http://pecl.php.net/package/sphinx
wget HTTP://PECL.PHP.NET/GET/SPHINX-1.3.3.TGZTAR-ZXVF sphinx-1.3.3.tgz
Install PHP extension must have Php-devel, no php-devel is missing phpize, will not produce source code files, yum installation test
Yum Install Php-develcd/usr/local/src/coreseek-4.1-beta/testpack/api/libsphinxclient/./configure
Checking for strings.h ... (cached) yeschecking for unistd.h ... (cached) yeschecking for stdint.h ... (cached) yesconfigure:creating./config.statusconfig.status:creating Makefileconfig.status:creating Sphinxclient_ config.hconfig.status:executing depfiles Commands
Make && make install
More information, such as the LD (1) and ld.so (8) Manual Pages.----------------------------------------------------------------------test-z "/usr/local/include" | | Mkdir-p--"/usr/local/include"/usr/bin/install-c-M 644 ' sphinxclient.h '/usr/local/include/sphinxclient.h ' make[1] : Leaving directory '/usr/local/src/coreseek-4.1-beta/testpack/api/libsphinxclient '
Cd/usr/local/src/sphinx-1.3.3phpize
Configuring for:php API Version:20090626zend Module API no:20090626zend Extension API no:220090626
./configure--with-php-config=/usr/bin/php-config--with-sphinx
Checking whether to build static libraries ... noconfigure:creating./config.statusconfig.status:creating config.hconfig.status:executing Libtool Commands
Make && make install
Build complete. Don ' t forget to run ' make test '. Installing Shared extensions:/usr/lib64/php/modules/
The resulting file
cd/etc/php.d///need to modify configuration file
Vim Sphinx.ini//The following two lines are written to the file
; Enable GD Extension moduleextension=sphinx.so
PHP is an Apache module, and Sphinx is also an extension of PHP. Restart Apache
Complete
-------Help ~~~~~-------
<?php
Echo phpinfo (); Header ("Content-type:text/html;charset=utf-8"); Echo ' <pre> '; $sphinx _obj = new Sphinxclient () ; $sphinx _obj->setserver (' 127.0.0.1 ', 9312); $sphinx _obj->setmatchmode (sph_match_any); $res = $sphinx _obj-> Query (' php ', ' * '); Var_dump ($sphinx _obj); exit ();
Baidu, Bing, Google, Sogou, 360 have been searched, encountered the same question of help, but there has been no solution ~ ~ do not know where the wrong ~ seniors See please leave your footsteps ~ Thank you ha ~
Install PHP extension Sphinx under CentOS