php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12813 Bug id #11058 but on linux.
Submitted: 2001-08-17 11:04 UTC Modified: 2002-11-11 03:34 UTC
Votes:9
Avg. Score:4.8 ± 0.4
Reproduced:9 of 9 (100.0%)
Same Version:1 (11.1%)
Same OS:4 (44.4%)
From: frank at telvia dot it Assigned:
Status: No Feedback Package: Network related
PHP Version: 4.0.6 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-20 09:41 UTC] frank at telvia dot it
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" Contrepois
 [2002-01-16 05:55 UTC] lobbin@php.net
Does this still apply on 4.1.1?
 [2002-02-17 00:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2002-06-17 09:28 UTC] the--dud at reservatory dot org
on 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!
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Fri Nov 16 02:01:26 2018 UTC