centos68安裝sphinx(php)

來源:互聯網
上載者:User

標籤:amp   replace   .so   list   mysq   close   組件   添加   api   

1.安裝前請先確定安裝了常用的組件

       yum install -y python Python-devel

2.安裝sphinx

tar zxvf sphinx-2.2.10-release.tar.gz
cd sphinx-2.2.10-release
./configure --prefix=/usr/local/sphinx –-with-MySQL
make && make install

在make時如果出現undefined reference to libiconv的錯

錯誤描述

/usr/local/sphinx/src/sphinx.cpp:20060:undefined reference to `libiconv_open‘
/usr/local/sphinx/src/sphinx.cpp:20078: undefined reference to `libiconv‘
/usr/local/sphinx/src/sphinx.cpp:20084: undefined reference to `libiconv_close‘
collect2: ld returned 1exit status
make[2]:***[indexer]Error1 www.111cn.NET
make[2]:Leaving directory `/home/sphinx/src‘
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/sphinx/src‘
make: *** [all-recursive] Error 1

解決辦法:


開啟configure檔案,找到“#define USE_LIBICONV 1”,將注釋去掉,並將1改成0。

3.libsphinxclient 安裝(PHP模組需要)


cd api/libsphinxclient
./configure –prefix=/usr/local/sphinx
make &&  make install

4.安裝PHP的Sphinx模組

:http://pecl.php.Net/package/sphinx


wget http://pecl.php.net/get/sphinx-1.3.3.tgz
tar zxf sphinx-1.3.3.tgz
cd sphinx-1.3.3
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-sphinx=/usr/local/sphinx/
make && make install

5.vi /etc/php.ini

添加 :extension = sphinx.so

重啟:service php-fpm restart(nginx伺服器)

centos68安裝sphinx(php)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.