The server suddenly failed to connect? Can't connect to the server you just purchased? Can't connect to Alibaba Cloud Hong Kong? Can't move the bricklayer? Vultr can't connect? I believe that many novice students have encountered this situation. Let’s analyze the cause of the problem for you.
What is the reason why the server cannot be connected?
This situation mostly occurs on foreign hosts. Due to the network environment, the connection may be blocked. It doesn't make sense. We only need to understand two commands here, and we can basically determine the reason.
Recommended related article tutorials: windows tutorial
Step one: Use the ping command to check whether the server IP is smooth
Take a Windows computer as an example. Press and hold the win key on the keyboard and press r again. A window will pop up. Then enter cmd in the window and press Enter.
Enter the ping command to ping your own server (you can also ping the DNS server to check your own network, as shown below)
If The connection failure here is most likely due to the firewall. Of course, this is not absolute. It is also possible that the server or supplier has banned ping, so this is just a preliminary judgment.
Step 2: Taking Windows 10 as an example, open the settings in the lower left corner
1. Enter telnet above the search, it will be displayed as shown below, enable or close Windows function, click on it
2. Find the Telnet client, check the box and start the installation
3. After installation, go back to the cmd window and enter the telnet IP port, as shown in the figure. If your server port is 22, replace 80 with 22. After pressing Enter, if it always displays Connecting , it means the port is unreachable.
Summary:
If ping fails and telnet works, it means the server can be connected.
If ping and telnet are successful, it means the server can be connected.
If ping fails or telnet fails, it means that the server cannot be connected, then there are only two possibilities, the server is shut down or blocked by the firewall.
If the server can be connected, but the program you deployed on the server cannot be detected through telnet, then there may be a problem during deployment or the server firewall or the service has not been started.
If the telnet connection cannot be connected, then it may only be a problem with the operator's GFW. This situation is relatively rare and may occur in some areas.
If the server suddenly fails to connect, first check it through ping and telnet. If neither works, it may be a network problem. Try again after a while or dial again, restart routing, and check the remote end. If the server is down and you are still unable to connect after a day or two, then it may be blocked by a firewall!
For more related knowledge, please pay attention to PHP Chinese website!
The above is the detailed content of Why can't I connect to the server?. For more information, please follow other related articles on the PHP Chinese website!