Req #11592 [Ana->Fbk]: need for an a SIGALRM based timeout mecanism

From: Date: Fri, 20 Jan 2017 17:05:58 +0000
Subject: Req #11592 [Ana->Fbk]: need for an a SIGALRM based timeout mecanism
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206768@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=11592&edit=1 ID: 11592 Updated by: heiglandreas@php.net Reported by: thomas dot morin at webmotion dot com Summary: need for an a SIGALRM based timeout mecanism -Status: Analyzed +Status: Feedback Type: Feature/Change Request Package: *General Issues Operating System: * PHP Version: * Block user comment: N Private report: N New Comment: Is this still relevant? Previous Comments: ------------------------------------------------------------------------ [2001-06-20 23:14:58] rasmus@php.net The problem is that at least with Apache we cannot use SIGALRM as Apache has taken that. When PHP is running as an embedded module in a web server, messing with the signals is usally a no-no. If you can come up with some way of doing this cleanly without signals, please speak up. And by the way, fsockopen() has a timeout parameter. ------------------------------------------------------------------------ [2001-06-20 17:12:15] thomas dot morin at webmotion dot com As mentionned in #9676, in #8595 and in comments in the set_time_limit function online manual page, set_time_limit seems to be not suitable to solve some problems like : - fopen on a url for which the distant server is not responding - exec an external program which hangs - trying to resolve some DNS name - sleep() - etc. The "better" solution I've read was a suggestion to use SOAP or XML-RPC to wrap such requests... this would be like using a hammer to kill a fly... :) It would be _great_ to have a mecanism (based on an alarm signal or similar for instance) to be able to define a timeout on all low-level functions (or at least some of them like fopen, fsockopen, exec, gethostby...). Such a missing feature can be a show stopper one for people needing to retrieve data from an (unreliable?) external datafeed for instance. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=11592&edit=1

« previous php.bugs (#206768) next »