|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24867 problem with timeout parameter for fsockopen() function
Submitted: 2003-07-30 06:06 UTC Modified: 2005-01-15 20:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: tomato at pisem dot net Assigned:
Status: Not a bug Package: Sockets related
PHP Version: 4.3.2 OS: FreeBSD-4.7-Stable
Private report: No CVE-ID: None
 [2003-07-30 06:06 UTC] tomato at pisem dot net
I'm trying to do socket connection with group of servers and for the server's that did not work function fsockopen() runs around 300-500 sec even the timeout is 10 sec.
i heard the problem was that this timeout used only in connect function, but not in gethostbyname
i read that you fixed this problem long time ago.. but my version is PHP 4.3.2RC4 (cli) (built: Jun 19 2003 14:41:09)
and the problem is still exists


Reproduce code:
$fp = fsockopen($href,$port,$errno,$errstr,10);

Expected result:
connect or failed to connect after 10 seconds or less

Actual result:
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /.../script.php


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-15 20:00 UTC]
We can't put a timeout in gethostbyname().
The connect() timeout works fine on sane systems.
Note that FreeBSD has issues when connecting to filtered remote addresses; this is reportedly fixed in FreeBSD 5.3.
There is no bug here that PHP can fix; move along.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Dec 06 15:01:27 2023 UTC