# Elasticsearch php client index operation is not return

**URL:** <https://discuss.elastic.co/t/elasticsearch-php-client-index-operation-is-not-return/29293>\
**Category:** Elasticsearch\
**Created:** [September 15, 2015, 3:45am UTC](https://discuss.elastic.co/t/elasticsearch-php-client-index-operation-is-not-return/29293 "2015-09-15T03:45:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cycleo](https://avatars.discourse-cdn.com/v4/letter/c/e480ec/32.png) [@cycleo](https://discuss.elastic.co/u/cycleo)\
**Post date:** [September 15, 2015, 3:45am UTC](https://discuss.elastic.co/t/elasticsearch-php-client-index-operation-is-not-return/29293/1 "2015-09-15T03:45:16Z")

</div>

I build Elasticsearch(1.6) and php client(1.2). I write a demo code to index a document,the code is below.the document wiil be indexed in the ES successfully . but "$ret = $client-\>index($params);" wiil be not return. the program can only be shutdown with Ctrl+C. I check the source code of php client. I found the program will be endless loop in the function private function executeHandles() in guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php

So I hope you can help me?  
Thanks in advance

the code is here:

require 'vendor/autoload.php';  
//Elastic search php client  
$params = array();  
$params['hosts'] = array (  
'[http://localhost:8098](http://localhost:8098)',  
);  
$client = new Elasticsearch\Client($params);  
$params = array();  
$params['body'] = array('testField' =\> 'dddd');  
$params['index'] = 'my\_index';  
$params['type'] = 'my\_type';  
$params['id'] = 'abc';  
echo 'index begin!';  
$ret = $client-\>index($params);  
echo 'index end!';  
var\_dump($ret);

---

<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:** [July 5, 2017, 11:50pm UTC](https://discuss.elastic.co/t/elasticsearch-php-client-index-operation-is-not-return/29293/2 "2017-07-05T23:50:21Z")

</div>


