11

I was following this instruction to validate my debugger configuration on Web Server. I uses a remote server whose FTP connection has been tested, but I get this warning message saying

Remote host is configured as 'localhost' despite server host is probably not local

enter image description here

My first question is: what does "remote host" and "server host" refer to respectively?

I know remote host is the setting xdebug.remote_host, and according to the xdebug documentation, it is "the host where the debug client is running".

This makes me confused: Isn't the debug client the IDE I am running on my local machine?

If yes, then shouldn't "the host where the debug client is running" be my local machines's IP address? If yes again, should I configure xdebug.remote_host to be my IP?

I tried setting it to my IP, the warning message does't show but it doesn't feel right because later I tried it with a random IP the message also doesn't show.

Secondly, the xdebug documentation also says that this xdebug.remote_host setting will be ignored if xdebug.remote_connect_back is enabled." Although not quite sure what this setting does, I set it to be "On", as the picture shows: enter image description here

I was hoping this will eliminate the warning message, but it is still there. So how do I get rid of this message?

4
  • 2
    1) If you have your xdebug installed on remote server then remote_host should have an IP of your computer where PhpStorm is running as sees from that remote server. For that you need to ensure that xdebug port is opened on your firewall/router -- in other words -- that xdebug is able to connect to your computer (because that's exactly how it works -- xdebug.org/docs/remote). 2) remote_connect_back can be dangerous -- anyone who will issue "debug this" commend will be able to communicate with your xdebug. But if you are happy to use it .. then you can ignore what IDE says. Commented Mar 15, 2016 at 9:25
  • Thank you. You are answering my questions. If I prove what you said, then this should be the answer. Commented Mar 15, 2016 at 12:15
  • 1
    3) If you can establish SSH connection to your server .. then you can use debugging over SSH and in such case the remote_host has to be local IP (e.g. 127.0.0.1) 4) remote_connect_back can be OK to use when server in in LAN (e.g VM or physical server somewhere next to you) Commented Mar 15, 2016 at 12:20
  • The documentation is in severe need of an overhaul. The issues with local machine and "remote server" are not only for you. Commented Jan 24, 2017 at 9:25

2 Answers 2

13

In my case, I had several apache virtual hosts setup for different projects. I was able to access projects via different urls, like : http://projectname1, http://anotherproject2 .

I was getting that same error in PhpStorm while doing xdebug validation:

Remote host is configured as “localhost” despite server host is probably not local

Problem was fixed, once in php.ini xdebug.remote_host matched the URL of the project I was debugging. So, if I was debugging http://project1, I would have this in php.ini:

xdebug.remote_host="project1"

Having values as 127.0.0.1, or localhost didn't fix it.

Hope it helps someone.

Sign up to request clarification or add additional context in comments.

1 Comment

I have similar setup as yours using vagrant + homestead and I followed your advice. Though the error message never went away, it didn't seem to hinder me debugging remotely. I could place a breakpoint and it would break as expected. Hope it helps someone.
0

Did you try with following?

xdebug.remote_host = "127.0.0.1"

7 Comments

Change the debugger setting on phpStorm as (Local web server or shared folder). Anyhow its going to be debugged in localhost.
I wanna do remote debugging, was following this confluence.jetbrains.com/display/PhpStorm/…
But, as of your phpinfo(), you have set up xdebug locally. possibly the following link might help. stackoverflow.com/questions/7234471/…
because previously you specified the remote_host as localhost. Where did you set up xdebug? if not in localhost, use the correct IP of the machine, and check if the port 9000 is accessible. (try "telnet host 9000" to on command prompt to check it is accessible)
xDebug is installed on remote server. I set xdebug.remote_host to its IP, and the validation went through. But I am still very confused with those questions I asked in my main question.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.