zoukankan      html  css  js  c++  java
  • 安装php扩展sphinx-1.2.0.tgz和libsphinxclient0.9.9


    一.首先安装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

  • 相关阅读:
    (转)WCF中的REST是什么
    DrpList
    IIS代码管理(1):遍历应用程序池和属性
    rdp,ListBox,Drp
    在.NET中杀死Word,Excel等进程
    IIS代码管理(2):创建应用程序池和属性
    防止用户重复登录
    asp.net2.0的几种自动生成脚本的原理以及应用
    工厂模式new问题
    我们需要什么样的字段类型?
  • 原文地址:https://www.cnblogs.com/dongruiha/p/7458650.html
Copyright © 2011-2022 走看看