官方地址:http://pecl.php.net/package/sphinx

wget http://pecl.php.net/get/sphinx-1.3.3.tgz
tar -zxvf sphinx-1.3..tgz

安装php扩展必须有php-devel,没有php-devel就缺少phpize,就不会产生源代码文件,yum安装测试一下

yum install php-devel
cd /usr/local/src/coreseek-4.1-beta/testpack/api/libsphinxclient/
./configure
checking for strings.h... (cached) yes
checking for unistd.h... (cached) yes
checking for stdint.h... (cached) yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating sphinxclient_config.h
config.status: executing depfiles commands
make && make install
more information, such as the ld() and ld.so() manual pages.
----------------------------------------------------------------------
test -z "/usr/local/include" || mkdir -p -- "/usr/local/include"
/usr/bin/install -c -m 'sphinxclient.h' '/usr/local/include/sphinxclient.h'
make[]: Leaving directory `/usr/local/src/coreseek-4.1-beta/testpack/api/libsphinxclient'
cd /usr/local/src/sphinx-1.3.
phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
./configure --with-php-config=/usr/bin/php-config --with-sphinx
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
make && make install
Build complete.
Don't forget to run 'make test'.
Installing shared extensions:     /usr/lib64/php/modules/
cd /etc/php.d/      //还需要修改配置文件
vim sphinx.ini //下面两行写入该文件
; Enable gd extension module
extension=sphinx.so
<?php

// echo phpinfo();
header("Content-type:text/html;charset=utf-8");
echo '<pre>';
$sphinx_obj = new SphinxClient();
$sphinx_obj->setServer('127.0.0.1',);
$sphinx_obj->setMatchMode(SPH_MATCH_ANY);
$res = $sphinx_obj->query('php','*');
var_dump($sphinx_obj);
exit();

百度、必应、google、搜狗、360都搜过了,遇到同样的求助问题,但一直没有解决方案~~不知道哪里错了~前辈们看到请留下您的脚步~谢谢哈~

Centos下安装php扩展sphinx的更多相关文章

  1. centos下安装php扩展php-memcached

    说来坎坷,为了安装这个php的扩展php-memcached,连操作系统都换了,从centos5.5升级到了centos6.8!! centos5.5中在安装php扩展php-memcached的依赖 ...

  2. CentOs下安装PHP扩展curl

    服务器运行一段时间后,可能突然会需求添加某个扩展,如curl.pdo.xmlrpc等,这就需要在不重新编译Linux PHP的情况下独立添加扩展. 1.安装crul wget http://curl. ...

  3. Centos下安装PHP ldap扩展

    Centos下安装PHP ldap扩展,有两种方法,仅供参考. 一.在线安装 执行下面命令: 1 yum install PHP-ldap 可能出现的问题: Error: php70w-common- ...

  4. centos下安装php环境

    centos下安装php环境 安装apache yum install httpd-devel 启动apache /etc/init.d/httpd start 安装mysql yum install ...

  5. Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)

    Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)   关于LAMP的各种知识,还请大家自行百度谷歌,在这里就不详细的介绍了,今天主要是介绍一下在Centos下安装,搭建一 ...

  6. CentOS下安装pip

    CentOS下安装pip 通常情况下使用命令: yum -y install pip 也有可能报错,无法安装.这是应该使用第二种方法. 1.首先需要先安装扩展源EPEL: yum -y install ...

  7. CentOS下安装hadoop

    CentOS下安装hadoop 用户配置 添加用户 adduser hadoop passwd hadoop 权限配置 chmod u+w /etc/sudoers vi /etc/sudoers 在 ...

  8. CentOS下安装使用start-stop-daemon

    CentOS下安装使用start-stop-daemon 在centos下下了个自启动的服务器脚本 执行的时候发现找不到start-stop-daemon命令 好吧 执行手动编译一下 加上这个命令 w ...

  9. 从零开始学 Java - CentOS 下安装 Tomcat

    生活以痛吻我,我仍报之以歌 昨天晚上看到那个冯大辉老师的微信公众号,「小道消息」上的一篇文章,<生活以痛吻我,我仍报之以歌>.知乎一篇匿名回答,主题为<冯大辉到底是不是技术大牛,一个 ...

随机推荐

  1. 编程:在屏幕中间分别显示绿色、绿底红色、白底蓝色的字符串 'welcome to masm!'

    body, table{font-family: 微软雅黑; font-size: 13.5pt} table{border-collapse: collapse; border: solid gra ...

  2. Django类方式写view

    问题: Django官方教程中都是通过def函数方式来写view,如何通过类方式写view以及为何要通过类方式写view? 那,如何解决这个问题? 用户访问浏览器,一般两种方式,get获取网页和pos ...

  3. 怎么查看mysql的安装目录

    如果忘记了MySQL的安装目录,怎么快速找到呢?方法或许很多,作者觉得这种最方便了 环境:windows+mysql+navicat 方法:进入mysql命令行输入:show variables li ...

  4. 一、Python表达式基础

    Python 能执行简单的计算器的功能: 如>>2+2 ==> 4,1/2==>0.5或者这样写1/2.0==>0.5(取浮点型) 1//2 ==>0 (" ...

  5. win7下JAVA环境变量配置方法

    1.首先,根据自己的需要下载1.6或者1.7的JDK,安装JDK.(安装的时候记一下安装目录,后面会用到) 2.右键计算机→属性→高级系统设置→高级→环境变量,在系统变量部分新建名为"JAV ...

  6. 使用EndNote在Word中插入参考文献的格式设置

    endnote其实自带了很多参考文献格式的样式,如下图,但往往跟我们要使用的会有所出入,本文主要介绍的就是设置自定义endnote参考文献格式,以endnote X6和word2003为例,其它版本以 ...

  7. android在一个应用程序员启动另一个程序

    一般我们知道了另一个应用的包名和MainActivity的名字之后便可以直接通过如下代码来启动: Intent intent = new Intent(Intent.ACTION_MAIN); int ...

  8. C# Linq基本常用用法

    1.什么是Linq? Lanaguage Interated Query(语言集成查询),Linq 是集成C# 和VB这些语言中用于提供数据查询能力的一个新特性. 这里只介绍两种基本常用用法. 学习方 ...

  9. Struts2是什么?

    Struts2是什么: Struts2是整合了struts1和webwork的技术优点的使用广泛的MVC框架: Struts2的特点: 1.基于MVC框架,结构清晰,便于开发人员掌控开发流程: 2.使 ...

  10. python自动化运维常用模块安装

    1.系统信息性能模块:psutil 源码安装: wget https://pypi.python.org/packages/source/p/psutil/psutil-2.0.0.tar.gz -- ...