Bug #54717 [NEW]: stream_set_timeout and popen don't work together

From: Date: Thu, 12 May 2011 09:23:22 +0000
Subject: Bug #54717 [NEW]: stream_set_timeout and popen don't work together
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-160692@lists.php.net to get a copy of this message
From:             
Operating system: Linux
PHP version:      5.3.6
Package:          Streams related
Bug Type:         Bug
Bug description:stream_set_timeout and popen don't work together

Description:
------------
---
From manual page: http://www.php.net/function.stream-set-timeout#Changelog
---

When open a stream with popen or proc_open, stream_set_timeout or stream_
set_ blocking fail (tested on Linux and Windows), while the manual says:
"As of PHP 4.3, this function can (potentially) work on any kind of
stream."
(while 'potentially' of course might mean everything ;-))


Test script:
---------------
$proc[0] = popen("/usr/srv/php /my/folder/myscript.php 0 &", "r"); 
$proc[1] = popen("/usr/srv/php /my/folder/myscript.php 1 &", "r");
if (!stream_set_timeout($proc[0], 1, 0)) print "stream_set_timeout failed
on stream 1"; 
if (!stream_set_timeout($proc[1], 1, 0)) print "stream_set_timeout failed
on stream 2";


Expected result:
----------------
It should NOT output:
stream_set_timeout failed on stream 1
stream_set_timeout failed on stream 2



-- 
Edit bug report at http://bugs.php.net/bug.php?id=54717&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=54717&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=54717&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=54717&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=54717&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54717&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=54717&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=54717&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=54717&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=54717&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=54717&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=54717&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=54717&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=54717&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=54717&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54717&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54717&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=54717&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=54717&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=54717&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=54717&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=54717&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#160692) next »