From:             kripper at imatronix dot cl
Operating system: Windows XP SP3
PHP version:      5.2.10
PHP Bug Type:     Streams related
Bug description:  proc_open doesn't read from stdin

Description:
------------
proc_open() doesn't read from stdin, when running PHP from console.
Reproduce code works on PHP 5.1.2.
popen works, but seems not to be suited for running interactive shell
commands from PHP.
Console scripts trying to run interactive commands will fail.

Reproduce code:
---------------
        $espec_descriptor = array(
           0 => fopen('php://stdin', 'r'),
           1 => fopen('php://stdout', 'w'),
           2 => array("file", "C:\\error-output.txt", "a")
        );

        $cmd = "<any command reading from stdin, for example: plink.exe>";

        $process = proc_open($cmd, $espec_descriptor, $pipes);
        
        if (is_resource($process)) {
                set_time_limit(0);
                return proc_close($process);
        } else {
                return -1;
        }

Expected result:
----------------
proc_open() should run the command and allow it to read from stdin.

Actual result:
--------------
Commands fail to read from stdin and close inmediatly.

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

Reply via email to