Database Connection Failed - php_network_getaddresses: getaddrinfo

The error message is mysqli_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/arcom/public_html/conn.php on line 21
PHP Warning:  mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/arcom/public_html/conn.php on line 21
This error message says that the server name in the mysqli_connect() method is not resolved.

The error is caused by the DNS server which couldn't resolve the server name (which is the domain used in the mysqli_connect() call). And that DNS server error is caused by one of two things.

The first is that your domain is down for more than a day. So the DNS server forgot the IP of your Domain (server name). The solution to this problem is to wait for two hours, and it will be fixed automatically.

The second is that you wrote the server name in the mysqli_connect() method call with wrong characters. So check your server name in the function call parameters in the conn.php file.

I hope you fix this error. See you next blog post. If you want to get new posts, make sure to subscribe to Value In Brief by Email.
Comment via Facebook
0 Comment via Google

0 تعليقات:

Post a Comment