Phpstorm + xdebug : Remote host is configured as "localhost" despite server host is probably not local - debugging

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
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:
I was hoping this will eliminate the warning message, but it is still there. So how do I get rid of this message?

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.

Did you try with following?
xdebug.remote_host = "127.0.0.1"

Related

windows: ping url fails but ping -4 url works in local network

I have been learning some network and system administration and encountered a puzzling problem.
SETUP:
I setup a small local offline network with a Windows Server 2019 and a Ubuntu server hosting gitea. In the Windows Server I have assigned a static IP of 169.254.0.2 and installed DNS and DHCP roles. In the Ubuntu server I have assigned a static IP of 169.254.0.3.
DNS has been configured with a primary zone funlab.abc. I created a single A record for gitea.funlab.abc. to point to 169.254.0.3. DHCP has been configured to lease addresses from 169.254.0.100 to 169.254.255.254. Subnet mask is 255.255.0.0.
PROBLEM:
With this setup, I successfully got client machines to connect to the local LAN network, transparently get a dynamic IP address, and access gitea.funlab.abc through the browser.
But in windows 10 client machines, I am unable to run ping gitea.funlab.abc in command prompt. I get an error message :
Ping request could not find host gitea.funlab.abc. Please check the name and try again
Git clone/push operations involving the URL gitea.funlab.abc also does not work.
However I can run ping -4 gitea.funlab.abc successfully. Git clone/push operations can also work if I replace the URL with the static IP. nslookup gitea.funlab.abc works correctly as well.
QUESTION:
Why is this happening? What did I misconfigure such that ping and git commands do not work?
Turns out ping and git commands works just fine when I change the IP address to 192.168.X.X. I guess windows treat the 169.254.X.X addresses differently.

SonarQube server not showing in browser

I have a Linux VM running with a Jenkins, Nexus and SonarQube server on it. The IP for the VM is 192.168.56.2 and I have no trouble accessing both Jenkins and Nexus on ports 8080 and 8081 respectively. However, when I try to access 192.168.56.2:9000 for SonarQube it just says 192.168.56.2 refused to connect.
When I run systemctl status sonar in the terminal it shows that SonarQube is active and running. I have opened the firewall to port 9000 and I have not changed any of the default settings. Does anyone have any idea what might be the issue?
SonarQube will only be listening on 'loopback' rather than on all inbound IP addresses. In your server's sonar.properties file, you'll need to set the Web information in order to access the server remotely, specifically the following values:
sonar.web.host: 192.168.56.2
sonar.web.port: 80 # if you want to use a port other than 9000
Also, in the web UI's Settings, under the "General" section, set the "Server base URL" value so that links and redirects issued by SonarQube target the correct location.

Laradock + PhpStorm + Xdebug Fails whereas PhpStorm Validation Succeeds

I've setup debug configuration for PhpStorm and it is successfully validated by PhpStorm:
Xdebug helper for Chrome is also installed.
The problem is that nothing happens when I start listening for debug connections and reload the required page with Xdebug helper switched on. Also tried this bookmarklets with no luck.
No errors or something, just nothing.
Also tried to set different IPs as dockerhost: from 192.168.. range (from network settings), from 172.* range (from nginx), from 10.* range (10.0.75.1 is default). Also tried docker.for.mac.internal.host which failed when containers were starting.
Docker 17.02, macOS Sierra, PhpStorm 2017.3
If you're on linux, be sure to create corresponding rules in your firewall.
But to troubleshoot this more effectively you need to gather more info.
Enable xdebug logging xdebug.remote_log=/var/www/xdebug.log in you
xdebug.ini or you can append that in the "Cli Interpreters > Configuration Options" in PHPStorm (xdebug.remote_log, /path/inside/workspace/container/xdebug.log)
Another step you could take is to monitor the incoming connections to your machine. (run this on where you installed docker). It will start listening to all incoming connection attempts on port 9000.
sudo tcpdump -i any port 9000
Now run the debugger once, check the logs inside the container (workspace by default) and see if any incoming connection attempts have gone through from the container.
If you see something like Time-out connecting to client (Waited: 200 ms). :-(, chances are that your firewall is blocking the incoming connections.
To open them up you could add a rule using ufw
sudo ufw allow in from 172.22.0.0/24 to any port 9000 (or write down a specific ip) Be sure to double check that this is the ip trying to connect
this will allow all connections on port 9000 from 172.22.0.* (which is what laradock uses for its virtual networks). Be sure to double check the logs maybe your setup uses different ip range)
My working xdebug.ini (both in php-fpm and workspace containers are the same)
xdebug.remote_host=dockerhost
xdebug.remote_connect_back=0
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_log=/var/www/xdebug.log
xdebug.cli_color=1
xdebug.profiler_enable=0
xdebug.profiler_output_dir="~/path/to/profiler.log"
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.var_display_max_children=-1
xdebug.var_display_max_data=-1
xdebug.var_display_max_depth=-1
If none of the above works, another step would be to also check if you have any containers running on port 9000 already. If so, then you'll need to use another, port, just don't forget to expose it from docker.
(Explanation: docker binds (exposes) ports to the host machine so that any incoming connections get directed to the right container, if 9000 is taken, xdebug won't be able to connect to any IDE on your machine, even if the IDE says it is running the listener)
Hope this helps.

website 404 error from external webbrowser

I can't get access to my website from external over the ip adress.
this works:
localhost/my_website // shows my web_site
https://IP-adress/ // I see xampp startpage
this doesn't work:
https://IP-adress/my_website //-> I get 404 error
when i add to the httpd.config file "listen 443" or "listen 80" the server doesn't start.
info: I'm using lubuntu(ubuntu)
Edit:
at pre-conclusion at least it has nothing to do with "listen "
The point is that just the folder /my_website,which shows my_website can't be shown from external computer,but xampp for an example is shown from external
I
You probably need to specify a host address, as well as a port. It's been a few years since I used xampp, but I'm guessing it defaults to localhost if no address is explicitly provided.
So, rather than "listen 80"/"listen 443", try "listen <ip address>:80"/"listen <ip address>:443".
For example: "listen 0.0.0.0:80" would allow you to reach your server from your local machine using both localhost and 127.0.0.1.

Xcode Server is unavailable

I am trying to setup CI on an Xcode Server. I have a Mac running OSX Server with Xcode Services up and running (seems to be working). The Mac is hosted in the cloud.
When I try to add the server to Xcode on my local Mac dev machine, it says "Xcode Server is unavailable". What "server address" do I use. I tried the IP address as well as the machinename.companyname.com address.
Note I have enabled the "file sharing" service and this works fine using machinename.companyname.com.
I configured my router to forward the relevant traffic to the server. This process is called port forwarding.
Opening these ports worked for me
Protocol Port Range ---- Comment
TCP 22 ---- ssh
TCP 80 ---- http
TCP 443 ---- https
TCP+UDP 3690 ---- svn
TCP+UDP 9418 ---- git
TCP+UDP 20300 ---- xcode1
TCP+UDP 20343-20345 ---- xcode2
reference: https://support.apple.com/en-ae/HT202944
I am having the same problem you are. My server is not in the cloud, but it is setup to be accessible outside of my network. I am able to add my server because it is seen by Bonjour. Everything works fine that way. However, I can't add the server by using the IP or the www address.
I've verified that TCP ports 22, 80, and 443 are forwarding correctly. I also have TCP/UDP 3690 and 9418 forwarded correctly.
One thing I wanted to add is that I can add repositories that exist on the server without issue. It is just adding the server that is causing a problem.
I have filed a bug report with Apple and will comment back here as soon as I get a response.
I think I solved my own problem. After upgrading to Xcode6, need to upgrade to Yosemite too. Don't know why but this seemed to fix the issue.

Resources