<p>Confirm the installation directory</p><p>请确认安装目录:/usr/local/xunsearch [Y/n]y</p><p>Checking scws ... no</p><p>Installing scws (1.2.3) ...</p><p>Extracting scws package ...</p><p>Configuring scws ...</p><p>Compiling & installing scws ...</p><p>Checking scws dict ... no</p><p>Extracting scws dict file ...</p><p>Checking libuuid ... no, try to install it</p><p>Extracting libuuid package ...</p><p>Configuring libuuid ...</p><p>Compiling & installing libuuid ...</p><p>Checking xapian-core-scws ... no</p><p>Installing xapian-core-scws (1.2.22) ...</p><p>Extracting xapian-core-scws package ...</p><p>Configuring xapian-core-scws ...</p><p>-----</p><p>checking whether g++ accepts -g... no</p><p>checking dependency style of g++... none</p><p>checking whether g++ is a working C++ compiler... no</p><p>configure: error:</p><p>*** You need a working C++ compiler to compile Xapian, but configure failed to</p><p>*** find one. If you have a working C++ compiler, you can tell configure where</p><p>*** to find it by invoking it like so:</p><p>***</p><p>*** ./configure CXX=/opt/bin/c++</p><p>-----</p><p>ERROR: failed to configure xapian-core-scws, see 'setup.log' for more detail</p><p>解决方案 安装g++</p><p>yum install gcc-c++</p><p>Checking scws ... 1.2.3</p><p>Checking scws dict ... ok</p><p>Checking libuuid ... yes: /usr/local/xunsearch</p><p>Checking xapian-core-scws ... no</p><p>Installing xapian-core-scws (1.2.22) ...</p><p>Extracting xapian-core-scws package ...</p><p>Configuring xapian-core-scws ...</p><p>-----</p><p>checking whether strerror_r is declared... yes</p><p>checking for strerror_r... yes</p><p>checking whether strerror_r returns char *... yes</p><p>checking whether sys_errlist is declared... yes</p><p>checking whether _sys_errlist is declared... yes</p><p>checking whether sys_nerr is declared... yes</p><p>checking whether _sys_nerr is declared... yes</p><p>checking for working ISO C90 conforming snprintf... snprintf</p><p>checking for zlib.h... no</p><p>configure: error: zlib.h not found - required for brass, chert and flint (you may need to install the zlib1g-dev or zlib-devel package)</p><p>-----</p><p>ERROR: failed to configure xapian-core-scws, see 'setup.log' for more detail</p><p>解决方法 安装 zlib模块</p><p>yum install zlib-devel</p><p></p><p></p><p>[XSException] ../lib/XS.php(2551): Connection refused(C#111, localhost:8383)</p><p>#0 ../lib/XS.php(2363): XSServer->connect()</p><p>#1 ../lib/XS.php(2348): XSServer->open('8383')</p><p>#2 ../lib/XS.php(370): XSServer->__construct('8383', Object(XS))</p><p>#3 ../lib/XS.php(262): XS->getIndex()</p><p>#4 Indexer.php(157): XSComponent->__get('index')</p><p>#5 {main}</p><p></p><p>端口没有启动</p><p>如果您的 SDK 调用和 xunsearch 服务端不在同一服务器,请使用 -b inet 方式启动脚本, 并注意借助类似 iptables 的防火墙来控制 xunsearch 的 8383/8384 两个端口的访问权限。 启动脚本用法举例如下,以下均为合法使用方式:</p><p>bin/xs-ctl.sh -b local start // 监听在本地回环地址 127.0.0.1 上</p><p>bin/xs-ctl.sh -b inet start // 监听在所有本地 IP 地址上</p><p>bin/xs-ctl.sh -b a.b.c.d start // 监听在指定 IP 上 我是不在同一服务器上,因此我选择这一种(bin/xs-ctl.sh -b 195.241.23.32 start)</p><p>bin/xs-ctl.sh -b unix start</p><p></p><p>/usr/local/xunsearch/bin/xs-ctl.sh start</p>