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

  • 相关阅读:
    doT js模板入门
    @SuppressWarnings忽略警告
    SQL注入
    【转】Oracle 执行动态语句
    连接数据库——模拟ATM机查、存、取、开户功能
    Oracle 函数中动态执行语句
    PowerDesigner建表
    数据库表设计—水电费缴费系统
    GUID全局唯一标识符相关知识了解
    Oracle数据库建表+添加数据练习
  • 原文地址:https://www.cnblogs.com/dongruiha/p/7458650.html
Copyright © 2011-2022 走看看