dongmou9260 2016-08-08 15:36
浏览 71

无法在Apache中解析PHP中的域名。 从命令行工作

we just migrated our production server to a new host (dedicated servers). And now we are unable resolve domain names from PHP pages when loaded from Apache. However, it works fine when we execute the php page from the command line. For example, the following PHP code returns the IP address when executed from command line but fails when page is loaded in browser thru Apache.

$ip = gethostbyname('www.google.com');
echo $ip;

Any thoughts? We are running Apache 2.4 on Windows Server 2012.

Thanks for your help.

  • 写回答

0条回答 默认 最新

    报告相同问题?