Couldn't resolve host name?

Anyone know why the following:


results in

[I]Warning: file_get_contents() [function.file-get-contents]: Couldn’t resolve host name in /home/account/public_html/test.php on line 2

Warning: file_get_contents( [function.file-get-contents]: failed to open stream: Permission denied in /home/account/public_html/test.php on line 2[/I]

This is on my VPS. allow_url_fopen is ON. Permissions on the directory are 777.

Read the error man: Couldn’t resolve host name
The hostname, here, is “”. This error tells you that the computer cannot find the server that is assigned to “”.

Either your server have no DNS, either you need to put a real address in there, or your DNS is misconfigured and don’t answer on your self defined zones.

I did read it, thank you.

I did use a real domain (I thought it went without saying that i wasn’t literally using - apparently not). The (real) domain and path work fine outside of the file_get_contents.

I don’t know about misconfigured DNS…

On the command line of the server, type nslookup (with your domain, of course) and see what it says. Or try pinging it. Again, from the command line of the server.

You are probably trying to get the contents of a file which is located on the same server as this script, some servers don’t allow this.