|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43057 mod_php can't resolve any hostname
Submitted: 2007-10-21 10:14 UTC Modified: 2007-11-12 10:15 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: bigboss at rambler dot ru Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 5.2.4 OS: FreeBSD 6.2
Private report: No CVE-ID: None
 [2007-10-21 10:14 UTC] bigboss at rambler dot ru
When I execute this script as (i.e. using apache with mod_php) - I see: Warning: readfile(): php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /usr/home/user/htdocs/script.php on line 3 Warning: readfile( failed to open stream: Bad file descriptor in /usr/home/user/htdocs/script.php on line 2

But when I execute this script with SSH as:

#php asdf.php

it's working!

Apache 2.2.6, PHP 5.2.4, FreeBSD 6.2

Reproduce code:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-21 10:40 UTC] bigboss at rambler dot ru
Some situation was described here:
But problem not fixed...
 [2007-10-22 08:09 UTC]
Does the same script work if you run it using PHP CLI? (command line)
 [2007-10-22 11:11 UTC] bigboss at rambler dot ru
Yes, it is.
 [2007-10-23 09:40 UTC]
Please check what the difference between linked libraries is between your PHP CLI binary and the in your system.
 [2007-10-23 09:51 UTC] bigboss at rambler dot ru
 [2007-10-23 10:38 UTC] bigboss at rambler dot ru
I am using php5 port for build PHP on my server...
 [2007-10-25 21:15 UTC] mail at czar dot dk
upgrade to PHP Version 5.2.5RC2-dev did not help, same problem appears

uname -a
FreeBSD 6.2-RELEASE-p8 FreeBSD 6.2-RELEASE-p8 #6: Fri Oct 12 17:23:48 CEST 2007  amd64

apache 2.0.61

configure options:
./configure --enable-bcmath --enable-calendar --enable-discard-path --enable-exif --enable-ftp --enable-gd-native-ttf --enable-libxml --enable-magic-quotes --enable-pic --enable-safe-mode --enable-sockets --enable-zip --prefix=/usr/local --with-apxs2=/usr/local/apache/bin/apxs --with-curl=/opt/curlssl/ --with-curlwrappers --with-freetype-dir=/usr/local --with-gd --with-gettext --with-imap=/opt/php_with_imap_client/ --with-imap-ssl=/usr/local --with-jpeg-dir=/usr/local --with-libxml-dir=/opt/xml2/ --with-mcrypt=/opt/libmcrypt/ --with-mhash=/opt/mhash/ --with-mysql --with-openssl=/usr/local --with-openssl-dir=/usr/local --with-png-dir=/usr/local --with-ttf --with-xpm-dir=/usr/local --with-zlib --with-zlib-dir=/usr --disable-ipv6
 [2007-10-29 10:27 UTC] bigboss at rambler dot ru
May be this is problem of FreeBSD 6.2? I have another server with FreeBSD 6.1 and it's working fine.
 [2007-10-31 11:51 UTC] mail at czar dot dk
upgraded my freebsd to 6.3 prerelease, it works again..

i'm reporting this to the freebsd community...
 [2007-11-12 10:15 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Apr 01 09:01:22 2020 UTC