Re: Re: No ouput until program end, why?
| From: | Marek Kilimajer | Date: | Fri, 04 Oct 2002 10:32:18 +0000 |
| Subject: | Re: Re: No ouput until program end, why? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-118843@lists.php.net to get a copy of this message | ||
Try checking the output_buffering option
Jean-Christian Imbeault wrote:
Ernani Joppert Pontes Martins wrote:Have you tried this way ? php -q your_file.php > /path/to/output_filenameHow would this help?? All that would do is redirect the output to a file. My problem is that I want output *before* the program ends ... Why aren't the echo statements I have in my for loop being printed out to the screen until the program terminates ??? I should get something printed out at every 100 lines ... but nothing gets printed until the end of the program ... At the end I get all the output I should. But not *before* the program ends ... Jc "Jean-Christian Imbeault" <jean_christian@myrealbox.com> escreveu na mensagem news:3D9D2008.7040908@myrealbox.com... I am running a PHP program under Linux on the command line. The problem I have is that I get no output to the screen until the program finishes. I have lots of echo statements throughout the program to help me debug but none of them are printed until the program finishes, which is really a pain since the prog takes 30 minutes to run ... The main() looks something like this. Can someone help me figure out why it is not printing anything until the program exists? pg_exec($CONN, "BEGIN"); for ($i = 0; $i < 6001; $i++) { $retval = process($aFields); if ( ($i % 100) == 0 ) echo "$i\n"; if ($retval == 1) echo "error on line $i \n"; } echo "COMMIT \n"; pg_exec($CONN, "COMMIT"); Thanks, Jc