# Remote Access Available But Local Access Not Available

**URL:** <https://discuss.elastic.co/t/remote-access-available-but-local-access-not-available/268752>\
**Category:** Elasticsearch\
**Created:** [March 30, 2021, 9:09am UTC](https://discuss.elastic.co/t/remote-access-available-but-local-access-not-available/268752 "2021-03-30T09:09:25Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![sewox](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@sewox](https://discuss.elastic.co/u/sewox)\
**Post date:** [April 8, 2021, 12:56pm UTC](https://discuss.elastic.co/t/remote-access-available-but-local-access-not-available/268752/21 "2021-04-08T12:56:04Z")

</div>

> [@dadoonet](#):
>
> ```auto
> <?php
> 
> $json = file_get_contents("http://10.21.8.146/");
> print_r($json);
> 
> ```

If I run this command, my login page successfully working.  
I added ": 9200", port number not responding anything.  
I created an issue on elasticsearch-php github page but nobody wrote an ansver.  
I have a mistake too. I did not write properly there.

Yes that's true, Elasticsearch accessible both of machine

> [@dadoonet](#):
>
> Elasticsearch is working well as accessible from both machine using the exact IP or localhost

Yes, Elasticsearch-PHP working remotly

> [@dadoonet](#):
>
> - Calling Elasticsearch from PHP works when the code is ran remotely

Yes, I run the same code on both machines. Elasticsearch-PHP working on the remote machine but cannot working on locally.

> [@dadoonet](#):
>
> - Calling Elasticsearch from PHP does not work using the exact same code when this code is ran locally

The reason I run it on the remote machine is just because I was wondering if it works.

> [@dadoonet](#):
>
> may be you could try something without using at all the Elasticsearch client

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 8, 2021, 1:08pm UTC](https://discuss.elastic.co/t/remote-access-available-but-local-access-not-available/268752/22 "2021-04-08T13:08:36Z")

</div>

Sorry. The right code to use is indeed:

```auto
<?php

  $json = file_get_contents("http://10.21.8.146:9200/");
  print_r($json);

```

> [@sewox](#):
>
> I added ": 9200", port number not responding anything.

So that confirms IMHO that you have a problem with the PHP server itself.  
I'm thinking of proxy, firewalls, things like that...

---

<div class="post-metadata">

**Author:** ![sewox](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@sewox](https://discuss.elastic.co/u/sewox)\
**Post date:** [April 8, 2021, 1:53pm UTC](https://discuss.elastic.co/t/remote-access-available-but-local-access-not-available/268752/23 "2021-04-08T13:53:43Z")

</div>

I guess you're right about my problem with the PHP version.  
Working elasticsearch machine has PHP version 7.3.27.  
Working machine use PHP version 7.2.34  
I try to fix PHP problem.

Thank you for supporting

---

<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 6, 2021, 1:54pm UTC](https://discuss.elastic.co/t/remote-access-available-but-local-access-not-available/268752/24 "2021-05-06T13:54:45Z")

</div>

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

[Previous page](https://discuss.elastic.co/t/remote-access-available-but-local-access-not-available/268752.md?page=1)
