|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-01-25 11:42 UTC] silverbanana at gmx dot de
Description:
------------
gethostbynamel always returns false, instead of giving useful results. This is however only the case when I use PHP as CGI. gethostbynamel works as expected when I use PHP as Apache module and also when I use it from the command line, but not when I use it as CGI.
If this behaviour of gethostbynamel is intended or unavoidable, it should be mentioned in the manual for gethostbynamel.
Reproduce code:
---------------
<?php
var_dump(gethostbynamel("localhost"));
?>
Expected result:
----------------
List of addresses
Actual result:
--------------
FALSE
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 22:00:01 2025 UTC |
It just came into my mind that other PHP functions will also need to resolve names. So I tried this one: $a = file_get_contents("http://www.google.de"); This results on PHP-CGI with Apache in: Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Der angegebene Host ist unbekannt. in D:\path\file.php So some Windows-API-function is failing. Btw, hosts is world readable (I think that's the way it should be, right) on my system so that can hardly be the reason.