Page 1 of 1

Apache/PHP can't resolve hostnames

PostPosted: 18. October 2004 04:36
by christh21
Apache can't resolve any hostnames. I want to use PHP to read a webpage, but it fails when I use a named-URL (like checkip.dyndns.org), but if I put in the IP address, it works just fine. However, if I run PHP at the command prompt, I CAN use the URL and it resolves just fine. I also noticed this problem when setting up a page to run PING and return the results. If I run PING on an IP address, it works fine, but if I pass a named-URL as the argument, it can't resolve it.

Obviously I have some problems with my DNS configuration. Anything run as root or user works just fine in resolving addresses, but anything running within Apache can't.

Any ideas? I'm running DeLi linux 0.6 (based on Slackware 7.1).

PostPosted: 18. October 2004 05:24
by christh21
I fixed it so if anyone else is having PHP getaddrinfo errors...

my resolv.conf file was in a folder "ppp" that had the wrong permissions to allow non-root access. I chmoded it to 755 and now it works fine.