|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-08-17 11:04 UTC] frank at telvia dot it
System Linux bato 2.2.19 #1 Thu Jun 7 10:44:22 Local time zone must be set--see zic manuali686 i686 unknown Build Date Aug 17 2001 Configure Command './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--prefix=/usr/local/php' '--with-openssl=/usr/local/' '--with-pgsql' '--without-mysql' Server API Apache when I try to fopen or include an url i got 2 warning: Warning: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/www/motoko/htdocs/cwnd-xml/parser-site-xml.php on line 374 Warning: Failed opening 'http://www.motoko.lan/cwnd-xml/CORPO/cwnd-parser-materiale.php?url=cwnd-materiale.xml' for inclusion (include_path='.:/usr/local/php/lib/php') in /home/www/motoko/htdocs/cwnd-xml/parser-site-xml.php on line 374 everything work fine with windows using fopen Frank "Pazzooo" Contrepois PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 05:00:01 2025 UTC |
It looks like the getaddrinfo function dont consider the /etc/hosts file so if a domain cant be converted to an ip using dns server then the error will show. if i try to do: include("on.my.etc.hosts.files/whatever") the error will show up if i do include("my.real.domain.on.the.internet") everything will work fine Frank "Pazzooo" Contrepoison a simple include("http://www.reservatory.org/file.ext"); the error would show up as 'Warning: php_network_getaddresses: getaddrinfo failed: Name or service not known in <URI>'. This has been checked with multiple domains. The bug was not present in 4.0.6 on our machine, but it is now. Feel free to analyse http://www.curbsqueal.com/dud/phpinfo.php. Another interesting this is that you have to add all subdomains to /etc/hosts too. Not only the main domain. For every new subdomain using php, you have to add them all. I believe this bug is caused by php not using the nameserver specified in /etc/resolv.conf. This is a very open bug indeed, because the simple act of searching for that line on google returns a whole stack of sites. The only solution is adding each and every site to /etc/hosts. Please look into this!