Centos下安裝php擴充sphinx

來源:互聯網
上載者:User

標籤:安裝測試   google   run   ring   3.3   php   產生   var   lin   

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

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

安裝php擴充必須有php-devel,沒有php-devel就缺少phpize,就不會產生原始碼檔案,yum安裝測試一下

yum install php-develcd /usr/local/src/coreseek-4.1-beta/testpack/api/libsphinxclient/./configure
checking for strings.h... (cached) yeschecking for unistd.h... (cached) yeschecking for stdint.h... (cached) yesconfigure: creating ./config.statusconfig.status: creating Makefileconfig.status: creating sphinxclient_config.hconfig.status: executing depfiles commands
make && make install
more information, such as the ld(1) and ld.so(8) manual pages.----------------------------------------------------------------------test -z "/usr/local/include" || mkdir -p -- "/usr/local/include" /usr/bin/install -c -m 644 ‘sphinxclient.h‘ ‘/usr/local/include/sphinxclient.h‘make[1]: Leaving directory `/usr/local/src/coreseek-4.1-beta/testpack/api/libsphinxclient‘
cd /usr/local/src/sphinx-1.3.3phpize
Configuring for:PHP Api Version:         20090626Zend Module Api No:      20090626Zend Extension Api No:   220090626
./configure --with-php-config=/usr/bin/php-config --with-sphinx
checking whether to build static libraries... noconfigure: creating ./config.statusconfig.status: creating config.hconfig.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 moduleextension=sphinx.so

php是apache的模組,sphinx又是php的擴充。重啟apache即可

完畢

 

-------求助~~~~~-------

<?php

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

 

百度、必應、google、搜狗、360都搜過了,遇到同樣的求助問題,但一直沒有解決方案~~不知道哪裡錯了~前輩們看到請留下您的腳步~謝謝哈~

Centos下安裝php擴充sphinx

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.