# Connection Timed Out Occasionally using PHP Client

**URL:** <https://discuss.elastic.co/t/connection-timed-out-occasionally-using-php-client/230497>\
**Category:** Elasticsearch\
**Created:** [April 30, 2020, 8:14am UTC](https://discuss.elastic.co/t/connection-timed-out-occasionally-using-php-client/230497 "2020-04-30T08:14:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohan\_5894](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rohan_5894/32/67407_2.png) [@rohan\_5894](https://discuss.elastic.co/u/rohan_5894)\
**Post date:** [April 30, 2020, 8:14am UTC](https://discuss.elastic.co/t/connection-timed-out-occasionally-using-php-client/230497/1 "2020-04-30T08:14:34Z")

</div>

Hi,

I have ES 7.6.2 installed on my AWS EC2 Ubuntu instance and it was working perfectly fine from months. Today i updated some security Ubuntu packages and after that the PHP client is getting timed out in most of the cases.

Please note that i am able to connect every-time via Curl & Kibana which are residing on that same server.

Elastic search is configured on localhost.

The strange part is that almost 10% of hits getting successful connection but fails 90% and gets timed out when trying using PHP client.

All requests via CURL & Kibana successfully connected every-time.

Not sure what has changed after those security updates on EC2

Can anyone please help?

Thanks

---

<div class="post-metadata">

**Author:** ![rohan\_5894](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rohan_5894/32/67407_2.png) [@rohan\_5894](https://discuss.elastic.co/u/rohan_5894)\
**Post date:** [April 30, 2020, 10:12am UTC](https://discuss.elastic.co/t/connection-timed-out-occasionally-using-php-client/230497/2 "2020-04-30T10:12:08Z")

</div>

Finally i have been able to fix it.

The culprit was Extended Host Configuration. I was using host configuration as follows:

'hosts' =\> [  
'hosts' =\> 'localhost',  
'port' =\> '9200',  
],

Which is breaking in 90% cases. Not sure why it has stopped working suddenly because it was working from months.

Anyways i just changed it to use like below and it is working perfectly again.

'hosts' =\> ['localhost:9200']

Thanks

---

<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:** [May 28, 2020, 10:12am UTC](https://discuss.elastic.co/t/connection-timed-out-occasionally-using-php-client/230497/3 "2020-05-28T10:12:16Z")

</div>

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