When we use file_get_contents, what does PHP use to resolve the domain name (local DNS?).
I ask because I got this error:
Warning: file_get_contents ( http://external-domain.com ) [function.file-get-contents]: failed to open stream: connection attempt failed because the connected party did not respond correctly after a period of time or the connection was established because the connected host could not respond. in C: \ test.php on line 11
I managed to fix this exact error earlier when I used file_get_contents()the internal URL, i.e. http://localhost:9090The problem was that I did not have a localhost mapping to 127.0.0.1 in my hosts file in my windows machine. By adding this, I was able to use file_get_contents()for internal urls.
Can this be eliminated in a similar way?
source
share