Bug #76251 [Opn->Fbk]: get_headers halt without any warning on unresolved hosts

From: Date: Mon, 23 Apr 2018 05:17:29 +0000
Subject: Bug #76251 [Opn->Fbk]: get_headers halt without any warning on unresolved hosts
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214837@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: requinix@php.net Reported by: i dot s dot azizy at gmail dot com Summary: get_headers halt without any warning on unresolved hosts -Status: Open +Status: Feedback Type: Bug Package: HTTP related Operating System: Linux workspace25 2.6.32-696.1.1 PHP Version: 5.6Git-2018-04-23 (Git) Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#214837) next »