Re[2]: [PHP] Re: system(), flush() and so on...
| From: | faeton | Date: | Fri, 30 Nov 2001 21:35:11 +0000 |
| Subject: | Re[2]: [PHP] Re: system(), flush() and so on... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-76255@lists.php.net to get a copy of this message | ||
Hello Darren,
------ manual cut --------
The system() call also tries to automatically flush the web server's
output buffer after each line of output if PHP is running as a server
module.
------ manual cut --------
Hehe. The problem is not in flushing ability of system() foo, but
flush() itself is not working :(
I've tried to install PHP as a module (as written above), cgi,
compiled with apache. But nothing worked.
DG> flush() will just empty the contents of the output buffer when it's called.
DG> You should do this after you output the command, yes, or the user will have
DG> to wait until the rest of the page is loaded. But this won't let you see
DG> the output as it is generated by the system() function.
DG> You may want to try popen instead. This gives you a pipe to the process, so
DG> you _should_ be able to read in lines of the output and display them as they
DG> appear, whilst using flush() (although I have never tried this myself so I
DG> can not vouch for it).
------------------------------------------------
Ivan 'Faeton aka xetrix' Danishevsky
ICQ(240266) faeton@xemichat.com www.xemichat.com