Bug #76251 [Fbk->NoF]: get_headers halt without any warning on unresolved hosts
| From: | php-bugs at lists dot php dot net | Date: | Sun, 24 Jun 2018 04:25:45 +0000 |
| Subject: | Bug #76251 [Fbk->NoF]: get_headers halt without any warning on unresolved hosts | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-215933@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76251&edit=1
ID: 76251
Updated by: php-bugs@lists.php.net
Reported by: i dot s dot azizy at gmail dot com
Summary: get_headers halt without any warning on unresolved
hosts
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: HTTP related
Operating System: Linux workspace25 2.6.32-696.1.1
PHP Version: 5.6Git-2018-04-23 (Git)
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2018-04-23 05:17:25] requinix@php.net
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(http://www.sport.ir): 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)
bool(false)
finished
which looks correct to me.
PS: That getaddrinfo warning would mean the domain name could not be resolved.
------------------------------------------------------------------------
[2018-04-23 04:58:05] i dot s dot azizy at gmail dot com
Description:
------------
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 http://www.sport.ir
Test script:
---------------
ini_set("max_execution_time", "0");
ini_set("max_input_time", "0");
set_time_limit(0);
// TEST ZONE START
error_reporting(E_ALL);
var_dump(get_headers('http://www.sport.ir'));
echo 'finished';
die;
// TEST ZONE END
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(http://www.sport.ir): 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 />
bool(false)
finished
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76251&edit=1