Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.