|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesbug64770.phpt (last revision 2013-11-14 10:14 UTC by s_kinon at yahoo dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-05-03 11:03 UTC] ab@php.net
[2013-05-03 11:03 UTC] ab@php.net
-Assigned To:
+Assigned To: ab
[2013-05-03 15:06 UTC] ab@php.net
[2013-05-03 15:06 UTC] ab@php.net
-Status: Assigned
+Status: Closed
[2014-10-07 23:19 UTC] stas@php.net
[2014-10-07 23:30 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 21:00:02 2025 UTC |
Description: ------------ When proc_open() delivers the pipes for a process, an attempt to stream_select on them fails. However using stream_get_contents() on the same readable pipes (like stdout) works fine. This bug currently prevents the phpt test suite from running on windows x64. Test script: --------------- <?php $descs = array( 0 => array('pipe', 'r'), // stdin 1 => array('pipe', 'w'), // stdout 2 => array('pipe', 'w'), // strerr ); $other_opts = array('suppress_errors' => false, 'binary_pipes' => true); $p = proc_open('dir', $descs, $pipes, '.', NULL, $other_opts); var_dump($p); if (is_resource($p)) { $data = ''; while (1) { $n = stream_select($pipes, $w = NULL, $e = NULL, 300); var_dump($n); if ($n === false) { echo "no streams \n"; break; } else if ($n === 0) { echo "process timed out\n"; proc_terminate($p, 9); break; } else if ($n > 0) { $line = fread($pipes[1], 8192); if (strlen($line) == 0) { /* EOF */ break; } $data .= $line; } } var_dump(strlen($data)); $ret = proc_close($p); var_dump($ret); } ?> ==DONE== Expected result: ---------------- resource(7) of type (process) int(5) int(42) int(0) ==DONE== Actual result: -------------- resource(7) of type (process) Warning: stream_select(): unable to select [2]: No such file or directory (max_fd=5) in C:\php-sdk\php55\vc11\x64\php-src\stream_select_0.php on line 18 bool(false) no streams int(0) int(255) ==DONE==