一.首先安装libsphinxclient(php模块需要)

cd /usr/local/src/
tar zxvf sphinx-0.9.9.tar.gz
cd sphinx-0.9.9/api/libsphinxclient/
./buildconf.sh
./configure
make
make install

安装过程中如果报下面的错:

修改sphinxclient.c:280行,void前面加上static声明

/usr/local/src/sphinx-0.9.9/api/libsphinxclient/sphinxclient.c line 280

But when I used "sudo make" I got this error:
sphinxclient.c:1216: error: static declaration of ‘sock_close’ follows non-static
declaration
sphinxclient.c:280: note: previous declaration of ‘sock_close’ was here

So I checked the file.

On line: 280
void sock_close ( int sock );

On line: 1216
static void sock_close ( int sock )
{
#if _WIN32
closesocket ( sock );
#else
close ( sock );
#endif
}

I changed the line 280 to:
static void sock_close ( int sock );

Then I could compile it without any errors.

二.安装PHP Sphinx 扩展模块

cd /usr/local/src/
tar zxvf sphinx-1.2.0.tgz
cd sphinx-1.2.0
/usr/local/php7/bin/phpize
./configure --with-php-config=/usr/local/php7/bin/php-config --with-sphinx=/usr/local/sphinx
make
make install

PHP配置

修改PHP.ini,
1.如果以前已配置过扩展目录则PASS

#extension_dir 目录根据 sphinx 扩展安装成功后提示的目录
extension_dir = "/usr/local/php7/lib/php/extensions/no-debug-non-zts-20121212/"

2.配置文件里启用扩展
[sphinx]
extension=sphinx.so

3.重启php

安装php扩展sphinx-1.2.0.tgz和libsphinxclient0.9.9的更多相关文章

  1. Centos下安装php扩展sphinx

    官方地址:http://pecl.php.net/package/sphinx wget http://pecl.php.net/get/sphinx-1.3.3.tgz tar -zxvf sphi ...

  2. linux-CentOS6.4安装Memcached+memcached扩展+安装memcache扩展+Memcache+mecached同步SESSION的几种方法

    一.编译环境的准备 yum install gcc  yum install gcc-c++ libstdc++-devel  yum install zlib-devel 二.源代码包准备 wget ...

  3. linux 下 php 安装 ZeroMQ 扩展

    一.下载安装源码包 ZeroMQ源码包下载地址: http://zeromq.org/area:download 如:zeromq-4.1.4.tar.gz   php的zmq扩展源码包 https: ...

  4. Centos环境下给PHP7.0安装yaf扩展

    首先要知道PHP的安装目录在哪里,以我当前的路径为例,在/usr/local/php目录下. 下一步需要下载扩展包,进入http://pecl.php.net/package/yaf寻找符合版本要求的 ...

  5. PHP7 学习笔记(一)Ubuntu 16.04 编译安装Nginx-1.10.3、 PHP7.0.9、Redis3.0 扩展、Phalcon3.1 扩展、Swoole1.9.8 扩展、ssh2扩展(全程编译安装)

    ==================== PHP 7.0 编译安装================== wget http://cn2.php.net/get/php-7.0.9.tar.bz2/fr ...

  6. Centos7下编译安装php扩展redis5.0.2

    安装环境:centos7 + php 7.2.191. 下载地址:http://pecl.php.net/get/redis-5.0.2.tgz .tgz http://pecl.php.net/ge ...

  7. 使用phpize安装php扩展

    环境: CentOs 6.3 php 7 nginx 举例: 安装ssh2扩展 1.登陆http://pecl.php.net,搜索ssh2,如下图所示,注意版本的选择要根据php的版本来 2.下载s ...

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

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

  9. linux php 安装 memcache 扩展

    1. memcached依赖于libevent,需要先安装libevent. tar zxvf libevent-2.0.21-stable.tar.gz cd libevent-2.0.21-sta ...

随机推荐

  1. 【Leetcode】【简单】【283. 移动零】【JavaScript】

    题目描述 283. 移动零 给定一个数组 nums,编写一个函数将所有 0 移动到数组的末尾,同时保持非零元素的相对顺序. 示例: 输入: [0,1,0,3,12]输出: [1,3,12,0,0] 说 ...

  2. 【产品对比】Word开发工具Aspose.Words和Spire.Doc性能和优劣对比一览

    转:evget.com/article/2018/4/3/27885.html 概述:Microsoft Office Word是微软公司的一个文字处理器应用程序,作为办公软件必不可少的神器之一,Wo ...

  3. bloomberg bulkFile解析

    文章导航 bloomberg bulkfile解析 bloomberg bulkfile 在oracle的存储 准备工作: Bloomberg 提供了以下文件 1 . fields.csv 下载地址: ...

  4. Maya mel maya档出现未知插件解决方法

    Maya mel maya档出现未知插件解决方法 以下 mel 代码,拷贝到 maya 的脚本编辑器的 mel 中,最好运行两次 string $unknownNodes[] = `ls -type ...

  5. IP分组

    IP 分组为了更准确地讨论 I n t e r n e t协议处理,我们必须定义一些名词.图 显示了在不同的I n t e r n e t层之间传递数据时用来描述数据的名词.我们把传输协议交给 I P ...

  6. Java集合--TreeSet

    转载请注明出处:http://www.cnblogs.com/skywang12345/admin/EditPosts.aspx?postid=3311268 第1部分 TreeSet介绍 TreeS ...

  7. 原生JS实现简单富文本编辑器

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  8. ComboGrid二级联动以及给二级联动赋默认值

    <input name="buyStatus" id="upbuyStatus" style="width: 100%;height: 85%& ...

  9. python panda读写内存溢出:MemoryError

    pandas中read_xxx的块读取功能 pandas设计时应该是早就考虑到了这些可能存在的问题,所以在read功能中设计了块读取的功能,也就是不会一次性把所有的数据都放到内存中来,而是分块读到内存 ...

  10. P3648 [APIO2014]序列分割 斜率优化

    题解:斜率优化\(DP\) 提交:\(2\)次(特意没开\(long\ long\),然后就死了) 题解: 好的先把自己的式子推了出来: 朴素: 定义\(f[i][j]\)表示前\(i\)个数进行\( ...