在Windows Xampp上安装和使用elasticsearch php客户端

时间:2016-12-26 15:38:20

标签: php windows elasticsearch xampp elastica

我从https://www.elastic.co/downloads/elasticsearch

下载了 elasticsearch-5.1.1.zip

然后使用此命令通过composer下载 Elastica 用于弹性搜索的PHP客户端

  

作曲家需要ruflin / elastica:dev-master

现在我想打开并进行测试。当我运行此命令时

  

仓\ elasticsearch.bat

我收到此错误:该命令的语法不正确。

另一方面,如果我尝试使用Elastica A PHP客户端,我会收到一些错误:

  

致命错误:未捕获的Elastica \ Exception \ Connection \ HttpException:   无法连接到主机,Elasticsearch了吗?在   E:\ XAMPP \ htdocs中\ EL \供应商\ ruflin \弹性弯曲\ LIB \弹性曲线\传输\ Http.php:180   堆栈跟踪:#0   E:\ XAMPP \ htdocs中\ EL \供应商\ ruflin \弹性弯曲\ LIB \弹性曲线\ Request.php(171):   Elastica \ Transport \ Http-> exec(Object(Elastica \ Request),Array)#1   E:\ XAMPP \ htdocs中\ EL \供应商\ ruflin \弹性弯曲\ LIB \弹性曲线\ Client.php(662):   Elastica \ Request-> send()#2   E:\ XAMPP \ htdocs中\ EL \供应商\ ruflin \弹性弯曲\ LIB \弹性曲线\ Client.php(673):   Elastica \ Client-> request('twitter /','DELETE',Array,Array)#3   E:\ XAMPP \ htdocs中\ EL \供应商\ ruflin \弹性弯曲\ LIB \弹性曲线\的index.php(531):   Elastica \ Client-> request('twitter /','DELETE',Array,Array)#4   E:\ XAMPP \ htdocs中\ EL \供应商\ ruflin \弹性弯曲\ LIB \弹性曲线\的index.php(165):   Elastica \ Index-> request('twitter /','DELETE')#5   E:\ XAMPP \ htdocs中\ EL \供应商\ ruflin \弹性弯曲\ LIB \弹性曲线\的index.php(258):   Elastica \ Index-> delete()#6 E:\ xampp \ htdocs \ el \ index.php(40):   Elastica \ Index-> create(Array,true)#7 {main}抛出   E:\ XAMPP \ htdocs中\ EL \供应商\ ruflin \弹性弯曲\ LIB \弹性曲线\传输\ Http.php   在第180行

我的问题是我如何使用elasticsearch-5.1?我在哪里做错了?

问候。

1 个答案:

答案 0 :(得分:3)