So I open a process with $process = proc_open("my_process", $descriptors, $pipes);
Then I write to the stdin of the process using fwrite($pipes[0], "some_command");
Then I have to close the pipe using fclose($pipes[0]);
before i can read from the pipes stdout using $output = stream_get_contents($pipes[1]);
. If I don't close the pipe my php script hangs on this call.
But once I have received the output from stdout what if I want to send another command to the process...the stdin pipe is closed so I have no way to send it. So is it possible to somehow send another command to the process?