Jump to content

Real time shell output


razta

Recommended Posts

Hi,

Currently I am echoing the output of a system() call after the command has terminated, is there any way for PHP to echo the output in real time rather than wait for the command to finish?

 

Here is what I am currently using:

echo '<pre>';
$scriptOutput = system($command, $retval);
echo '</pre>';

 

Thank you in advance.

Link to comment
https://forums.phpfreaks.com/topic/183077-real-time-shell-output/
Share on other sites

Hrmmm, I don't think it's possible since system() returns all of the information at the same time.  I don't think output buffering will make it real time, although it will make it be done right after the system() call (unless the webserver buffers, or the browser buffers).

Thanks for the replys. I will have a look into buffering and see if that fixes my problem.

 

Another quick question I have is would it be possible to send a command to a shell and then disconnect it from PHP? When I currently run a command my PHP page continualy loads until the command has finished, is there a way jut to send the command and not have PHP continuesly loading?

 

Thanks again!  :D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.