# Unable to Connect with elastic cloud

**URL:** https://discuss.elastic.co/t/unable-to-connect-with-elastic-cloud/332456
**Category:** Elasticsearch
**Created:** [May 3, 2023, 4:24pm UTC](https://discuss.elastic.co/t/unable-to-connect-with-elastic-cloud/332456 "2023-05-03T16:24:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Mohd\_Ahmad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohd_ahmad/32/118963_2.png) [@Mohd\_Ahmad](https://discuss.elastic.co/u/Mohd_Ahmad)
#### Post date: [May 3, 2023, 4:24pm UTC](https://discuss.elastic.co/t/unable-to-connect-with-elastic-cloud/332456/1 "2023-05-03T16:24:54Z")

</div>

Uncaught Elastic\Transport\Exception\NoNodeAvailableException: No alive nodes. All the 1 nodes seem to be down.

My php client is hosted at 000webhost and i am creating client with api key and cloud id but it is throwing this error

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [May 3, 2023, 6:14pm UTC](https://discuss.elastic.co/t/unable-to-connect-with-elastic-cloud/332456/2 "2023-05-03T18:14:42Z")

</div>

Hi @Mohd_Ahmad Welcome to the Community and Thanks for Trying Elastic Cloud.

1. Is your Elastic Cloud Deployment Healthy / Green Yes / No

 ![Screenshot 2023-05-03 at 11.12.36 AM](https://us1.discourse-cdn.com/elastic/original/3X/c/e/cec128bd555f010b5f2a6367ee2beb4acfc83dd3.png)

1. Can you curl your elastic Cloud From the Server where the PHP is running

`curl -u elastic:password https://mydeployment1235.es.us-west1.gcp.cloud.es.io`

 ![Screenshot 2023-05-03 at 11.10.01 AM](https://us1.discourse-cdn.com/elastic/original/3X/6/f/6f7c56eb2389c987a2c32f0380edcd80c4428491.png)

1. iI that work then You need to share your PHP code

---

<div class="post-metadata">

### Author: ![Mohd\_Ahmad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohd_ahmad/32/118963_2.png) [@Mohd\_Ahmad](https://discuss.elastic.co/u/Mohd_Ahmad)
#### Post date: [May 4, 2023, 1:30am UTC](https://discuss.elastic.co/t/unable-to-connect-with-elastic-cloud/332456/4 "2023-05-04T01:30:06Z")

</div>

First of all thank you for your warm welcome.

1. Yes my elastic cloud deployment is healthy
2. I am using 000webhost which is free to host a php website so i don't have a terminal so i tried this code to run as index.php :

\<?php echo 'welcome'; require\_once '../phpelasticsearch/vendor/autoload.php'; // assuming Guzzle is installed via Composer use GuzzleHttp\Client; $client = new Client(['base\_uri' =\> 'https://sma-sjmc.es.asia-south1.gcp.elastic-cloud.com', 'auth' =\> ['elastic', '##########################'] ]); $response = $client-\>get('/'); echo $response-\>getBody(); ?\>

> And getting this error:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/7/47958fe20b94649f268ddf3177c73bc21f7e4b55.png)

have a look: I had tried to curl using my local machine terminal and it is responding.  
I am even able to connect by the php client in my local machine

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [May 4, 2023, 2:35am UTC](https://discuss.elastic.co/t/unable-to-connect-with-elastic-cloud/332456/5 "2023-05-04T02:35:46Z")

</div>

Apologies I know nothing about your hosting env... Nor the other tool guzzle...

The guzzle does not look like it is executing the curl correctly.

Your cluster appears healthy I think you may need to visit the forums about those tools.

Or you could try PHP on your local machine to test. Then translate up to.your hosting

---

<div class="post-metadata">

### Author: ![Mohd\_Ahmad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohd_ahmad/32/118963_2.png) [@Mohd\_Ahmad](https://discuss.elastic.co/u/Mohd_Ahmad)
#### Post date: [May 4, 2023, 2:46am UTC](https://discuss.elastic.co/t/unable-to-connect-with-elastic-cloud/332456/6 "2023-05-04T02:46:22Z")

</div>

Actually i had tried in my local to connect my elastic cloud and it is working fine but when i am hosting my php client it is not working and giving the error i have posted earlier

---

<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: [June 6, 2023, 8:56am UTC](https://discuss.elastic.co/t/unable-to-connect-with-elastic-cloud/332456/8 "2023-06-06T08:56:38Z")

</div>

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