From:             jlondon at mail dot mcg dot edu
Operating system: Windows NT Server 4.0
PHP version:      4.3.0
PHP Bug Type:     IIS related
Bug description:  Proc_open hangs

proc_open hangs on the example that is in the manual.  Here is the code.

$descriptorspec = array(
   0 => array("pipe", "r"),  // stdin is a pipe that the child will read
from
   1 => array("pipe", "w"),  // stdout is a pipe that the child will write
to
   2 => array("file", "c:/temp/error-output.txt", "a"), // stderr is a
file to write to
);
$process = proc_open("c:\php\php.exe", $descriptorspec, $pipes);
if (is_resource($process)) {
    // $pipes now looks like this:
    // 0 => writeable handle connected to child stdin
    // 1 => readable handle connected to child stdout
    // Any error output will be appended to /tmp/error-output.txt

    fwrite($pipes[0], "<?php echo \"Hello World!\"; ?>" . chr(3));
    fclose($pipes[0]);

    while(!feof($pipes[1])) {
        echo fgets($pipes[1], 1024);
    }
    fclose($pipes[1]);
    // It is important that you close any pipes before calling
    // proc_close in order to avoid a deadlock
    $return_value = proc_close($process);

    echo "command returned $return_value\n";
}

I'm running NT4 Server/PHP4.3.2.2/IIS4.  This bit of code opened up 54
php.exe/cmd.exe (that's 54 of each or 108 total) processes on my machine.
-- 
Edit bug report at http://bugs.php.net/?id=22458&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22458&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22458&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22458&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22458&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22458&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22458&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22458&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22458&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22458&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22458&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22458&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22458&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22458&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22458&r=gnused

Reply via email to