|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76251 get_headers halt without any warning on unresolved hosts
Submitted: 2018-04-23 04:58 UTC Modified: 2018-06-24 04:25 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: i dot s dot azizy at gmail dot com Assigned:
Status: No Feedback Package: HTTP related
PHP Version: 5.6Git-2018-04-23 (Git) OS: Linux workspace25 2.6.32-696.1.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: i dot s dot azizy at gmail dot com
New email:
PHP Version: OS:


 [2018-04-23 04:58 UTC] i dot s dot azizy at gmail dot com
when you call get_headers function with unresolved url (url has dns and ip but is not responding) within script codes running script will be finished without any warning after a short timeout less that one minutes. there is not any warning or return value! running it alone did not raise this error.
pay attention : url must has valid dns ip but has not any response to requests like

Test script:
ini_set("max_execution_time", "0");
ini_set("max_input_time", "0");

echo 'finished';

Expected result:
<br />
<b>Warning</b>:  get_headers(): php_network_getaddresses: getaddrinfo failed: Name or service not known in <b>[SCRIPT-PATH]/[SCRIPT-NAME]</b> on line <b>7</b><br />
<br />
<b>Warning</b>:  get_headers( failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in <b>[SCRIPT-PATH]/[SCRIPT-NAME]</b> on line <b>7</b><br />


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-04-23 05:17 UTC]
-Status: Open +Status: Feedback
 [2018-04-23 05:17 UTC]
PHP 5.6 is no longer supported. Please test with PHP 7.1 or 7.2.

When I try your script I get:

Warning: get_headers( failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
 in (file) on line (line)

which looks correct to me.

PS: That getaddrinfo warning would mean the domain name could not be resolved.
 [2018-06-24 04:25 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 21:01:33 2024 UTC