fredv
January 25, 2012, 9:43pm
1
Hi,
in my website, i’m getting information from another site with curl_url and curl_exec functions.
On Virtualmin it doesn’t work because it seems not to be able to access DNS to translate the url
same with
file_get_contents(“http://www.google.com ”)
i get an error :
failed to open stream: php_network_getaddresses
what can i do to allow my php/apache to get url resolved ?
thanks
Eric
January 25, 2012, 10:03pm
2
Howdy,
You may want to make sure that DNS resolution is currently working on your system.
For example, what output do you get when running this command:
host google.com
fredv
January 25, 2012, 10:09pm
3
Hi,
everything works when i’m in console
only php seems to be unable to resolve dns
host google.com
google.com has address 173.194.67.104
google.com has address 173.194.67.105
google.com has address 173.194.67.106
…
fredv
January 26, 2012, 6:47pm
4
oh, i have found the fix !
in BIND’s config i had put
recursion no;
now i have put :
recursion yes;
allow-recursion {
127.0.0.1;
};
it works fine now
Eric
January 26, 2012, 7:06pm
5
Howdy,
Hmm, well that’s unusual! I’m surprised that worked from the command line, but not from Apache/PHP.
However, I’m glad you found the fix, thanks for sharing that!
-Eric