<?php
ob_start();
$scriptFile = "/stutest.sh";
$descriptorspec = array(
0 => array("pipe", "r"), // stdin
1 => array("pipe", "w"), // stdout
2 => array("pipe", "w") // stderr
);
$process = proc_open(escapeshellarg($scriptFile), $descriptorspec, $pipes, NULL);
while (!feof($pipes[1])) {
// Read StdOut
print_r(fread($pipes[1], 1024));
ob_flush();
flush();
}
fclose($pipes[1]);
proc_close($process);
?>Warning: Cannot modify header information - headers already sent in /home/xxxxx/manager/includes/document.parser.class.inc.php on line 2620
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
PHP error debug
Error: Cannot modify header information - headers already sent
Error type/ Nr.: Warning - 2
File: /home/xxxxx/manager/includes/document.parser.class.inc.php
Line: 469
Line 469 source: header(’Content-Type: ’ . $type . ’; charset=’ . $this->config[’modx_charset’]);
You could kill the existing output buffer and then do your flush()’ing; otherwise, none of the output is going to be rendered until the page is finished processing.
I removed the flush() function and now the pages parses but it is not bringing back the output of the script as it happens - rather it just shows the whole thing when it has completed - anyone know what modx command to use in the place of flush() ?
ob_get_contents(); ob_end_flush();
Warning: Cannot modify header information - headers already sent in /hsphere/local/home/zenbed/thehub.jswebconsole.co.uk/manager/includes/document.parser.class.inc.php on line 2620
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
PHP error debug
Error: Cannot modify header information - headers already sent
Error type/ Nr.: Warning - 2
File: home/mydomain.co.uk/manager/includes/document.parser.class.inc.php
Line: 469
Line 469 source: header(’Content-Type: ’ . $type . ’; charset=’ . $this->config[’modx_charset’]);