I'm working with elasticsearch on a php project. I have a file (elastic.php) where there is :
<?php
require 'vendor/autoload.php';
$hosts = [
'host'=>'localhost'
];
$client = Elasticsearch\ClientBuilder::create()->setHosts($hosts)->build();
$params = [
'index' => 'test',
'type' => 'test',
'id' => 1,
'client' => [ 'ignore' => 404 ]
];
echo $client->get($params);
But when I do php elastic.php
I have the following issue :
Stack trace:
#0 /path/to/elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ClientBuilder.php(452): Elasticsearch\ClientBuilder::defaultHandler()
#1 path/to/elasticsearch/elastic.php(7): Elasticsearch\ClientBuilder->build()
#2 {main}
And when I do :
curl --version
I have :
curl 7.35.0 (x86_64-pc-linux-gnu) libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3
I am on Ubutnu, with php 5.6.32 and using elasticsearch 5.
Thansk for the help guys