您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Linux 安装php sphinx模块

2024/3/17 12:07:00发布43次查看
环境:
ubuntu 14.04  php5.59 mysql 5.5 
1.下载sphinx扩展 http://pecl.php.net/package/sphinx 选择需要的版本,然后解压并执行
root@iz282i5hw2tz:~/sphinx-1.1.0# /usr/bin/phpizeconfiguring for:php api version: 20121113zend module api no: 20121212zend extension api no: 220121212root@iz282i5hw2tz:~/sphinx-1.1.0#
2.安装 libsphinxclient
root@iz282i5hw2tz:~/coreseek-3.2.14/csft-3.2.14/api/libsphinxclient# ./configure
root@iz282i5hw2tz:~/coreseek-3.2.14/csft-3.2.14/api/libsphinxclient# make && make install
3.安装sphinx模块
root@iz282i5hw2tz:~/sphinx-1.1.0# ./configure --with-php-config=/usr/bin/php-config --with-sphinx
root@iz282i5hw2tz:~/sphinx-1.1.0# make/bin/bash /root/sphinx-1.1.0/libtool --mode=compile cc -i. -i/root/sphinx-1.1.0 -dphp_atom_inc -i/root/sphinx-1.1.0/include -i/root/sphinx-1.1.0/main -i/root/sphinx-1.1.0 -i/usr/include/php5 -i/usr/include/php5/main -i/usr/include/php5/tsrm -i/usr/include/php5/zend -i/usr/include/php5/ext -i/usr/include/php5/ext/date/lib -i/usr/local/include -dhave_config_h -g -o2 -c /root/sphinx-1.1.0/sphinx.c -o sphinx.lo libtool: compile: cc -i. -i/root/sphinx-1.1.0 -dphp_atom_inc -i/root/sphinx-1.1.0/include -i/root/sphinx-1.1.0/main -i/root/sphinx-1.1.0 -i/usr/include/php5 -i/usr/include/php5/main -i/usr/include/php5/tsrm -i/usr/include/php5/zend -i/usr/include/php5/ext -i/usr/include/php5/ext/date/lib -i/usr/local/include -dhave_config_h -g -o2 -c /root/sphinx-1.1.0/sphinx.c -fpic -dpic -o .libs/sphinx.o/root/sphinx-1.1.0/sphinx.c: in function 'php_sphinx_client_read_property':/root/sphinx-1.1.0/sphinx.c:105:2: error: too few arguments to function 'std_hnd->read_property' retval = std_hnd->read_property(object, member, type tsrmls_cc); ^/root/sphinx-1.1.0/sphinx.c: in function 'zim_sphinxclient_updateattributes':/root/sphinx-1.1.0/sphinx.c:1040:6: warning: passing argument 2 of 'memset' makes integer from pointer without a cast [enabled by default] memset(vals_mva, null, values_mva_size); ^in file included from /usr/include/features.h:374:0, from /usr/include/stdlib.h:24, from /usr/include/php5/main/php_config.h:2418, from /usr/include/php5/main/php.h:33, from /root/sphinx-1.1.0/sphinx.c:26:/usr/include/x86_64-linux-gnu/bits/string3.h:76:1: note: expected 'int' but argument is of type 'void *' __nth (memset (void *__dest, int __ch, size_t __len)) ^/root/sphinx-1.1.0/sphinx.c: in function 'zm_startup_sphinx':/root/sphinx-1.1.0/sphinx.c:1888:43: warning: assignment from incompatible pointer type [enabled by default] php_sphinx_client_handlers.read_property = php_sphinx_client_read_property; ^make: *** [sphinx.lo] error 1
这里有个报错,修改 sphinx.c 第105行为:
retval = std_hnd->read_property(object, member, type tsrmls_cc, null);
然后编译即可通过
4 编辑 php.ini
extension=sphinx.so
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product