|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22837 stream_set_timeout() does not work on stdin
Submitted: 2003-03-24 00:59 UTC Modified: 2003-03-24 06:29 UTC
Avg. Score:4.0 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: gavin at itmerge dot com Assigned:
Status: Wont fix Package: Filesystem function related
PHP Version: 4.3.1 OS: Linux Kernel 2.4.18
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-03-24 00:59 UTC] gavin at itmerge dot com
/* in php 4.3 with the CLI interface
STDIN is predefined */

while ($auth==0 && time()<$time+60) {
  while(!feof(STDIN) && $auth==0 && time()<$time+60) {

if (time()>=$time+60) echo "You have timedout\n";
/* I never get to the above line 
because It sits there at fgets never timing out.
i've tried 
set_time_limit(60) and ini_set("max_execution_time",60)
but nothing will stop the script from executing.
i'm running this script thru tcpd
if it gets stuck waiting for input i have to manually kill
all the processes, gets very very icky. :(
btw. i've also tried $stdin=fopen("php://stdin","r");
ps. i know it's new :), i know it says "potentially"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-24 06:29 UTC]
This wont be fixed in 4.3.x; you can use stream_select() instead.
PHP5 will have better general support for stream_set_timeout().

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 10:01:31 2024 UTC