RE: Re[2]: [PHP] Re: system(), flush() and so on...

From: Date: Fri, 30 Nov 2001 21:33:07 +0000
Subject: RE: Re[2]: [PHP] Re: system(), flush() and so on...
Groups: php.general 
Request: Send a blank email to php-general+get-76256@lists.php.net to get a copy of this message
Good day, Oops, you're right. I did not read that line nor was I aware of that. I just tried <?php system("traceroute www.google.com"); ?> . It works exactly as it says it should- outputs the lines as they come in. I also know flush() works fine (at least for me). Perhaps you could provide some information about your O/S and PHP version? ============================ Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -----Original Message----- From: faeton [mailto:faeton@ua.fm] Sent: Friday, November 30, 2001 2:35 PM To: Darren Gamble Cc: php-general@lists.php.net Subject: Re[2]: [PHP] Re: system(), flush() and so on... 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

« previous php.general (#76256) next »