# Error 500 : localhost can't handle request

**URL:** <https://discuss.elastic.co/t/error-500-localhost-cant-handle-request/97824>\
**Category:** Elasticsearch\
**Created:** [August 21, 2017, 8:42pm UTC](https://discuss.elastic.co/t/error-500-localhost-cant-handle-request/97824 "2017-08-21T20:42:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gamer\_Dude](https://avatars.discourse-cdn.com/v4/letter/g/bbce88/32.png) [@Gamer\_Dude](https://discuss.elastic.co/u/Gamer_Dude)\
**Post date:** [August 21, 2017, 8:42pm UTC](https://discuss.elastic.co/t/error-500-localhost-cant-handle-request/97824/1 "2017-08-21T20:42:40Z")

</div>

I enabled error on php and this was the message returned.

Array ( [took] =\> 1 [timed\_out] =\> [\_shards] =\> Array ( [total] =\> 10 [successful] =\> 10 [failed] =\> 0 ) [hits] =\> Array ( [total] =\> 0 [max\_score] =\> [hits] =\> Array ( ) ) )

this is my code

\<?php require 'vendor/autoload.php'; $hosts = ['http://localhost:9200/',]; $client = Elasticsearch\ClientBuilder::create() -\>setHosts($hosts) -\>build(); $params = ['index' =\> 'test', 'body' =\> [ 'query' =\> [ 'match' =\> [ 'title' =\> 'fish',] ] ] ]; $response = $client-\>search($params); print\_r($response);

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 18, 2017, 8:42pm UTC](https://discuss.elastic.co/t/error-500-localhost-cant-handle-request/97824/2 "2017-09-18T20:42:45Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
