日期:2014-05-16  浏览次数:20472 次

sphinx安装中问题及注意

?

sphinx以及中文分词安装网上方法很多,这里不说了。在我安装过成中出现的问题:

1 在安装过程中出现

/usr/local/sphinx-0.9.9/src/sphinx.cpp:20060: undefined reference to `libiconv_open’

/usr/local/sphinx-0.9.9/src/sphinx.cpp:20078: undefined reference to `libiconv’

/usr/local/sphinx-0.9.9/src/sphinx.cpp:20084: undefined reference to `libiconv_close’

解决办法:打开configure文件,找到“#define USE_LIBICONV 1”,将注释去掉,并将1改成0。这种方法也适用其他软件安装是遇到同样问题的解决;

2 在创建索引的时候出现的错误

error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory

解决办法:

64位系统ln -s /usr/local/webserver/mysql/lib/mysql/libmysqlclient.so.16.0.0 /usr/lib64/libmysqlclient.so.16

32位系统ln -s /usr/local/webserver/mysql/lib/mysql/libmysqlclient.so.16.0.0 /usr/lib/libmysqlclient.so.16

3 在PHP调用的时候,记得要启动sphinx

/usr/local/webserver/sphinx/bin/searched

4 sphinx.conf文件索引修改后要重新创建索引

/usr/local/webserver/sphinx/bin/indexer –all