Install PHP extension Sphinx under CentOS

Source: Internet
Author: User

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

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.