From: RQuadling at GMail dot com Operating system: Windows XP SP3 PHP version: 5.3CVS-2009-04-07 (snap) PHP Bug Type: Streams related Bug description: stream_set_blocking() not working on proc_open()'d pipes
Description: ------------ I'm trying to set non-blocking mode on pipes attached to a process opened using proc_open. The documentation and the user notes suggest that what I am doing should work. Running this with php -n to remove my ini file settings. Reproduce code: --------------- <?php echo PHP_VERSION, ' ', PHP_OS, ' ', PHP_SAPI, PHP_EOL; echo 'INI:', php_ini_loaded_file(), PHP_EOL; // Define the descriptors. $a_Descriptors = array(0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w')); // Provide a place for the pipes. $a_Pipes = array(); // Create the thread. $r_Thread = proc_open("dir c:\\ /b", $a_Descriptors, $a_Pipes, Null, $_ENV); // Display the current STDOUT meta data. print_r(stream_get_meta_data($a_Pipes[1])); // Try to change the blocking mode to non-blocking. echo (stream_set_blocking($a_Pipes[1], False) ? 'Successfully' : 'Failed'), ' to set blocking mode to non-blocking', PHP_EOL; // Display the current STDOUT meta data. print_r(stream_get_meta_data($a_Pipes[1])); Expected result: ---------------- 5.3.0RC2-dev WINNT cli INI: Array ( [stream_type] => STDIO [mode] => r [unread_bytes] => 0 [seekable] => [timed_out] => [blocked] => 1 [eof] => ) Successfully set blocking mode to non-blocking Array ( [stream_type] => STDIO [mode] => r [unread_bytes] => 0 [seekable] => [timed_out] => [blocked] => [eof] => ) Actual result: -------------- 5.3.0RC2-dev WINNT cli INI: Array ( [stream_type] => STDIO [mode] => r [unread_bytes] => 0 [seekable] => [timed_out] => [blocked] => 1 [eof] => ) Failed to set blocking mode to non-blocking Array ( [stream_type] => STDIO [mode] => r [unread_bytes] => 0 [seekable] => [timed_out] => [blocked] => 1 [eof] => ) -- Edit bug report at http://bugs.php.net/?id=47918&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47918&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47918&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47918&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47918&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47918&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47918&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47918&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47918&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47918&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47918&r=support Expected behavior: http://bugs.php.net/fix.php?id=47918&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47918&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47918&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47918&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47918&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=47918&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47918&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47918&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47918&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47918&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47918&r=mysqlcfg