• Register
0 votes
47 views

Problem :

I am new to PHP. I have written my first db.php IM USING CLOUD9 is my host.

But I am facing below error while trying to execute my code

Php_network_getaddresses getaddrinfo failed name or service not known

How to fix above error?

8 4 2
2,300 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I have read your question. It seems you have just started learning PHP.

I can explain this in simple English, this error message simply means: "I am unable to know the address of your server."

Now in technical words the error message means a hostname which you are trying to connect is not having any public nameserver record.

A database server can only be accessed by very few specific servers, it is because of the security feature just to prevent a whole world from accessing it. So everyone simply can not try to access or hack it

A host is the server which is allowed to connect to your database server which might most probably be a server you upload all your html/php/.. files to.

This error is simply caused by the network related stuff and it is not caused by your programming mistakes.

I hope the way I explained to you must so now it must be very helpful to you in resolving it.

5 2 1
4,980 points

Related questions

0 votes
1 answer 2 views
2 views
Problem: getaddrinfo: nodename nor servname provided, or not known.
asked 1 day ago Dan phillip 1.9k points
0 votes
1 answer 26 views
26 views
Problem: I get this message when i login with Filezilla. “Connection attempt failed with "eai_noname - neither nodename nor servname provided, or not known” Can any one guide further? My domain name is aaa.bbbb.com and cpanel ftp configuration told me that ftp server is ftp.aaa.bbb.com Looks like something related with dns resolving?
asked Jul 16, 2020 quizzBabes 160 points
2 votes
1 answer 58 views
58 views
Problem : I am very new to SQL Server 2008 Management Studio. I have recently connected my SQL Server 2008 Management Studio with Windows authentication. After that I am facing below error "The request failed or the service did not respond in a timely fashion. Consult the event ... to fix above error from past couple of days but I am unable to fix it. Can somebody guide me in fixing above error ?
asked Mar 25, 2020 morrisBson 3.2k points
0 votes
1 answer 11 views
11 views
I keep on recieving this error in my php project “failed to open stream: no such file or directory” each time I need to include a php file. What is the best practice to include another php file from a different folder? Is it also possible to include a php file located in a different domain?
asked Oct 12, 2020 azriel 590 points
0 votes
1 answer 53 views
53 views
Problem: How can we solve this problem? Is there any alternate solution?
asked Nov 19, 2020 prog_learner 2.5k points
0 votes
1 answer 23 views
23 views
Problem Failed to open stream: HTTP wrapper does not support writeable connections.
asked Feb 9 charles mathews 3.8k points
0 votes
1 answer 119 views
119 views
Problem: I am trying to send the email to my gmail address but it keeps on showing below error: "SMTP -> ERROR: Failed to connect to server: Connection timed out (110)SMTP Connect() failed. Message was not sent.Mailer error: SMTP Connect() failed." Please find ... ;             } else {             echo 'Message has been sent.';            } How can I fix above error message related to PHPMail?
asked Jul 31, 2020 Raphael Pacheco 4.9k points