Can't resolve domain names in php under apache
I had the same problem in my development that only occurs executing php under apache, but directly with php, it works!
php filetest.php
Then I checked my apache status and I saw this in log:
Mar 12 13:01:08 arch-linux apachectl[6847]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::6aa3:c4ff:fe...is message
After some search I found it:
http://tutorialforlinux.blogspot.com.br/2013/10/solve-problem-ah00558-when-restarting.html
And this was the exaclty problem, then I changed this in my httpd.conf:
#ServerName www.example.com:80
To this:
ServerName localhost
It works, now I can resolve dns in php under apache.
Sorry about my bad english, I would like to detail more.