|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22302 fsockopen() : php_network_getaddresses: getaddrinfo failed
Submitted: 2003-02-19 11:58 UTC Modified: 2003-02-21 05:16 UTC
From: admin at iut-info dot ens dot univ-reims dot fr Assigned:
Status: Not a bug Package: Sockets related
PHP Version: 4.3.0 OS: HP-UX 11.11
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
40 + 19 = ?
Subscribe to this entry?

 [2003-02-19 11:58 UTC] admin at iut-info dot ens dot univ-reims dot fr
The script :
echo "$nom=$adr<BR />";
$fp=fsockopen ($adr, 110, $errno, $errstr, 30);
if (!$fp) {
    echo "$errstr ($errno)<br>\n";
} else {
    echo fgets ($fp,128) . "<BR />\n";
    fputs ($fp, "QUIT\r\n");
    echo fgets ($fp,128) . "<BR />\n";
    fclose ($fp);

----- Result (work's fine) ----------
+OK POP3 iut-info v4.41 server ready
+OK Sayonara 
------ But if i try (other lines not changed) ------
$fp=fsockopen ($nom, 110, $errno, $errstr, 30);
----- Result ------------

Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: host nor service provided, or not known in /home/prof/collet/public_html/testsock.php on line 14

Warning: fsockopen() [function.fsockopen]: unable to connect to mail:110 in /home/prof/collet/public_html/testsock.php on line 14
Protocol not supported (221)
From the doc, hostname could be a name, not only a IP.

----- PHP Compile with ---------------
./configure                             \
        --with-oci8                     \
        --with-apache=../apache_1.3.27  \
        --with-gd                       \
        --with-pdflib=/opt/pdflib       \
        --with-jpeg-dir                 \
        --with-png-dir                  \
        --with-tiff-dir                 \
        --with-zlib                     \
        --with-bz2                      \
        --enable-sigchild               \
        --with-mysql=/opt/mysql         \
        --with-pgsql=/opt/pgsql         \
        --with-tsrm-pthreads            \
        --with-dom                      \


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-19 12:11 UTC] admin at iut-info dot ens dot univ-reims dot fr
No probleme with PHP 4.2.3 on the same server.

(PHP 4.2.3 is include in HP WebServer Suite,
distributed by HP, in binary format)
 [2003-02-19 20:25 UTC]
Please try using this CVS snapshot:
For Windows:

Please try a snapshot.

 [2003-02-20 11:22 UTC] admin at iut-info dot ens dot univ-reims dot fr
I've downloaded php4-STABLE-200302201630

Compil/install Ok (on another port)

Same error.
 [2003-02-21 04:19 UTC] admin at iut-info dot ens dot univ-reims dot fr
After some search, i've found that the "getaddrinfo" function doesn't work under HP-UX 11.11 (ok for host
in the host file, ko for dns).

I apply 3 patch :
  PHCO_27740 libc cumulative patch
  PHCO_24402 libc cumulative header file patch
  PHNE_27796 libnss_dns DNS backend patch

And now the script works fine.

I give the info for the other HP-UX and PHP users.
I think you can close the bug.

 [2003-02-21 05:16 UTC]
Not a bug in PHP, so marking as bogus.

Thanks for looking into this; we don't really have
any HP-UX resources ourselves.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat May 28 19:03:50 2022 UTC