Edit report at https://bugs.php.net/bug.php?id=62697&edit=1
ID: 62697 Updated by: larue...@php.net Reported by: brandon dot landry at dvusd dot org Summary: stream_get_line hangs -Status: Open +Status: Feedback Type: Bug Package: Filesystem function related Operating System: suse PHP Version: 5.3.15 Block user comment: N Private report: N New Comment: I can not reproduce this on linux, (after replace the stream_get_line to fgets); could you please provide a reproducable script? Previous Comments: ------------------------------------------------------------------------ [2012-07-30 15:57:01] brandon dot landry at dvusd dot org Description: ------------ In php 5.3.11 there was some change made to stream_get_line which causes this test script to hang (it still hangs on the latest version from 5.3 and 5.4 branches). In the changelog for that version it says stream_get_line was changed to be more in line with fgets ... Now if you replace stream_get_line with fgets the script does run seemingly correctly ... The only reason I am reporting this is, if the function was changed to be more in line with fgets, and fgets works but stream_get_line does not, ... is this a bug or something I am missing. Test script: --------------- <?php $descSpec = array( array('pipe','r'), // stdin array('pipe','w'), // stdout array('pipe','w') // stderr ); $proc = proc_open('bash', $descSpec, $pipes,'/tmp',array()); if(!is_resource($proc)){ throw new Exception("Could not open bash process"); } $stdin = &$pipes[0]; $stdout = &$pipes[1]; $stderr = &$pipes[2]; stream_set_blocking($stdout,0); stream_set_blocking($stderr,0); fwrite($stdin, "pwd\n"); fflush($stdin); $write = null; $except = null; $stdoutArr = array($stdout); $rv = stream_select($stdoutArr,$write,$except,1); $strIn = stream_get_line($stdout,4096); var_export(array('streamSelect_returnVal'=>$rv,'stdout_strRead'=>$strIn)); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62697&edit=1