安装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
最新文章
- discuz教程:discuz模板js与jQuery冲突的解决方案
- Qt使用自带的windeployqt 生成exe来发布软件
- 初学web开发——怎么解决无法找到路径的问题
- 数论 UVA 11076
- U3D4.X版本无法安装MONODEV编辑器
- HTML调用servlet(一)
- js为元素添加onclick事件
- PHP JS HTML ASP页面跳转代码 延时跳转代码
- 动态网页制作PHP常用的正则表达式
- Codeforces Round #367 (Div. 2) B. Interesting drink (模拟)
- C#之父 Anders Hejlsberg
- Javascript异步请求你能捕获到异常吗?
- Linux 组与用户
- 关于lower_bound的使用
- 设计模式4 外观模式 FACADE
- LxNx前端F2F面试问题整理
- [TFRecord文件格式]基本介绍
- SQL 数据库语言分析总结(三)
- 目录导航「深入浅出ASP.NET Core系列」
- docker创建image