Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function run($command)
- {
- $descriptorspec = array(
- 0 => array("pipe","r"),
- 1 => array("pipe","w"),
- 2 => array("file","./error.log","a")
- );
- $process = proc_open($command, $descriptorspec, $pipes);
- if (is_resource($process))
- {
- while ($s = fgets($pipes[1]))
- {
- print $s;
- flush();
- }
- fclose($pipes[1]);
- proc_close($process);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement