What I want to do is have parent and child process communication, but I still want to be able to see the child's echos. The manual mentions that you don't have to use only the file descriptors 0, 1, and 2 when opening the pipes, but it does not mention how to access any other pipes.
I want to do something like:
Code: Select all
$descriptorspec = array(
3 => array("pipe", "r"), // a pipe that the child will read from...3 is a non-standard file descriptor
4 => array("pipe", "w"), // a pipe that the child will write to... 4 is a non-standard file descriptor
);
Code: Select all
$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", "/tmp/error-output.txt", "a") // stderr is a file to write to
);
-Jake Levitt