Forum Moderators: coopster
warning: Temporary failure in name resolution
warning: Bad file descriptor
warning: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
warning: Bad file descriptor
can this have happened because while it was uploading (a whole diffrent part of the site) i accidently went to another page? (not in ftp, but ensim)
How can i solve this? Is this solvable?
checkout in which line the name resolution occured. this is maybe a failure of a php function which was not able to resolve a network address.
if this is true, then your code has no failure, you just have to check the case, that name resolution might fail.
you can disable the warning messages by adding the '@' in front of any specific php command, like: @fopen(...), so this single command (file opening) won't output any error or warning while executing (i.e. file does not exists). only this single command, the rest in your script will.
34: $fils = "http://www.example.com/webgids/dochters.txt";
35: $linez = file($fils);
Here are the 1st 2 warnings in full:
Warning: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home/virtual/site47/fst/var/www/html/webgids/index.php on line 35
Warning: file("http://www.example.com/webgids/dochters.txt") - Bad file descriptor in /home/virtual/site47/fst/var/www/html/webgids/index.php on line 35
<added> i downloaded the text file, deleted the file from the server, and uploaded it again. The error(s) are still is there. aarg.
Weird thing is, the homepage also uses file(); to get content, and that works just fine, no errors.
please read the documentation of the fopen function and take a look at the details to open urls. check if your php is enabled to do so. try to find out, why php can't resolve the domain name, maybe checkout if php supplies a dns resolve function or similar.
Hakre, are you saying that another machine pointing to the same URL will do fine?
if the file exists on the server, every app and machine can request it, if
a) dns works (domain name resolution)
b) a connection between client and server is possible
c) both machines speak the same protocol
so: yes.
in this case, php had problems to resolve the ip address of the domain name. if php is not able to resolve it will never be able to even request the file.
since ikbenhet1 changed the domain name to the ip address, name resolution wasn't needed anymore and the script works again.
-hakre